Skip to content
Snippets Groups Projects
Commit 515b43e5 authored by Martin Lowe's avatar Martin Lowe :flag_ca:
Browse files

fix(gitlab): Remove prefetch of users read in script to address timeouts

While less efficient during the run, the precache of users due to spam accounts has grown too large and crashes the script. In place, we will have a user cache that fetches users as needed from the API and inserting them into the cache.
parent 34985983
No related branches found
No related tags found
1 merge request!332fix(gitlab): Remove prefetch of users read in script to address timeouts
Pipeline #68601 passed
......@@ -411,14 +411,9 @@ export class GitlabWrapper {
this.logger.info('Populating Issues cache');
this.issuesCache = Array.from(await this.api.Issues.all({ author_username: this.config.user }));
this.logger.info('Populating Gitlab users cache');
const users = await this.api.Users.all();
this.logger.info('Mapping Gitlab users');
// we cannot fetch all users for cache here as it times out the entire script
// instead, we will have a simple map of username => user object fetched as needed
this.namedUsersCache = {};
for (const user of users as Array<SimpleUserSchema>) {
this.namedUsersCache[user.username] = user;
}
} catch (e) {
this.logger.error(e);
this.logger.error(`Cannot fetch resources associated with sync operations, exiting: ${e}`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment