Merge remote-tracking branch 'origin/develop' into staging

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-09-27 19:45:55 +07:00
commit 2929c07bc0
No known key found for this signature in database
GPG Key ID: BD80F68D68D8F7F2
3 changed files with 13 additions and 10 deletions
dev/tool/src
server
account/src
backup/src

View File

@ -837,7 +837,7 @@ export function devTool (
}) })
program program
.command('backup-compact-s3 <bucketName> <dirName>') .command('backup-s3-compact <bucketName> <dirName>')
.description('Compact a given backup to just one snapshot') .description('Compact a given backup to just one snapshot')
.option('-f, --force', 'Force compact.', false) .option('-f, --force', 'Force compact.', false)
.action(async (bucketName: string, dirName: string, cmd: { force: boolean, print: boolean }) => { .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 }) ctx.error('no workspace', { workspace: workspace.name, email })
throw new PlatformError(new Status(Severity.ERROR, platform.status.Forbidden, {})) 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 () => { void ctx.with('update-last-visit', {}, async () => {
await updateLastVisit(db, ws, account as Account) await updateLastVisit(db, ws, account as Account)
}) })

View File

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