mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 08:48:01 +00:00
UBERF-7743: Make check-clean non blocking (#6195)
This commit is contained in:
parent
824defc6e3
commit
623649f6d9
@ -120,15 +120,26 @@ export class PlatformWorker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const checkClean = async (): Promise<void> => {
|
||||||
|
const rateLimit = new RateLimiter(10)
|
||||||
for (const workspace of workspacesToCheck) {
|
for (const workspace of workspacesToCheck) {
|
||||||
// We need to connect to workspace and verify all installations and clean if required
|
// We need to connect to workspace and verify all installations and clean if required
|
||||||
try {
|
try {
|
||||||
|
await rateLimit.add(async () => {
|
||||||
ctx.info('check clean', { workspace })
|
ctx.info('check clean', { workspace })
|
||||||
|
try {
|
||||||
await this.cleanWorkspaceInstallations(ctx, workspace)
|
await this.cleanWorkspaceInstallations(ctx, workspace)
|
||||||
|
} catch (err: any) {
|
||||||
|
ctx.error('failed to check clean', { workspace })
|
||||||
|
}
|
||||||
|
})
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
ctx.error('failed to clean workspace', { err, workspace })
|
ctx.error('failed to clean workspace', { err, workspace })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
await rateLimit.waitProcessing()
|
||||||
|
}
|
||||||
|
void checkClean()
|
||||||
|
|
||||||
void this.doSyncWorkspaces().catch((err) => {
|
void this.doSyncWorkspaces().catch((err) => {
|
||||||
ctx.error('error during sync workspaces', { err })
|
ctx.error('error during sync workspaces', { err })
|
||||||
@ -220,7 +231,7 @@ export class PlatformWorker {
|
|||||||
try {
|
try {
|
||||||
workspaceInfo = await getWorkspaceInfo(token)
|
workspaceInfo = await getWorkspaceInfo(token)
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
this.ctx.error('Workspace not found:', { workspace })
|
ctx.error('Workspace not found:', { workspace })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (workspaceInfo === undefined) {
|
if (workspaceInfo === undefined) {
|
||||||
|
Loading…
Reference in New Issue
Block a user