catalog-backend: fixes for GitLab discovery .updateLastActivity()
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -888,8 +888,6 @@ export class GitLabDiscoveryProcessor implements CatalogProcessor {
|
||||
_optional: boolean,
|
||||
emit: CatalogProcessorEmit,
|
||||
): Promise<boolean>;
|
||||
// (undocumented)
|
||||
updateLastActivity(): Promise<string | undefined>;
|
||||
}
|
||||
|
||||
// Warning: (ae-missing-release-tag) "inputError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
|
||||
@@ -142,9 +142,10 @@ export class GitLabDiscoveryProcessor implements CatalogProcessor {
|
||||
return true;
|
||||
}
|
||||
|
||||
async updateLastActivity(): Promise<string | undefined> {
|
||||
const lastActivity = await this.cache.get('last-activity');
|
||||
await this.cache.set('last-activity', new Date().toISOString());
|
||||
private async updateLastActivity(): Promise<string | undefined> {
|
||||
const cacheKey = `processors/${this.getProcessorName()}/last-activity`;
|
||||
const lastActivity = await this.cache.get(cacheKey);
|
||||
await this.cache.set(cacheKey, new Date().toISOString());
|
||||
return lastActivity as string | undefined;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user