UBERF-8302: Fix lastVisit (#6755)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-09-27 18:03:10 +07:00 committed by GitHub
parent 14e6a85301
commit 7cb6c3a89a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 10 deletions

View File

@ -837,7 +837,7 @@ export function devTool (
})
program
.command('backup-compact-s3 <bucketName> <dirName>')
.command('backup-s3-compact <bucketName> <dirName>')
.description('Compact a given backup to just one snapshot')
.option('-f, --force', 'Force compact.', false)
.action(async (bucketName: string, dirName: string, cmd: { force: boolean, print: boolean }) => {

View File

@ -1760,7 +1760,7 @@ export async function getWorkspaceInfo (
ctx.error('no workspace', { workspace: workspace.name, email })
throw new PlatformError(new Status(Severity.ERROR, platform.status.Forbidden, {}))
}
if (_updateLastVisit && isAccount(account)) {
if (_updateLastVisit && (isAccount(account) || email === systemAccountEmail)) {
void ctx.with('update-last-visit', {}, async () => {
await updateLastVisit(db, ws, account as Account)
})

View File

@ -101,14 +101,17 @@ class BackupWorker {
async schedule (ctx: MeasureContext): Promise<void> {
console.log('schedule timeout for', this.config.Interval, ' seconds')
this.interval = setTimeout(() => {
if (this.backupPromise !== undefined) {
void this.backupPromise.then(() => {
void this.triggerBackup(ctx)
})
}
void this.triggerBackup(ctx)
}, this.config.Interval * 1000)
this.interval = setTimeout(
() => {
if (this.backupPromise !== undefined) {
void this.backupPromise.then(() => {
void this.triggerBackup(ctx)
})
}
void this.triggerBackup(ctx)
},
5 * 60 * 1000
) // Re-check every 5 minutes.
}
async backup (