mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-19 14:55:31 +00:00
Allow to rebuild elastic for all workspaces (#1862)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
578283d78b
commit
b79d4f757a
@ -244,11 +244,21 @@ program
|
|||||||
})
|
})
|
||||||
|
|
||||||
program
|
program
|
||||||
.command('rebuild-elastic <workspace>')
|
.command('rebuild-elastic [workspace]')
|
||||||
.description('rebuild elastic index')
|
.description('rebuild elastic index')
|
||||||
.action(async (workspace, cmd) => {
|
.action(async (workspace, cmd) => {
|
||||||
|
return await withDatabase(mongodbUri, async (db) => {
|
||||||
|
if (workspace === undefined) {
|
||||||
|
const workspaces = await listWorkspaces(db)
|
||||||
|
|
||||||
|
for (const w of workspaces) {
|
||||||
|
await rebuildElastic(mongodbUri, w.workspace, minio, elasticUrl)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
await rebuildElastic(mongodbUri, workspace, minio, elasticUrl)
|
await rebuildElastic(mongodbUri, workspace, minio, elasticUrl)
|
||||||
console.log('rebuild end')
|
console.log('rebuild end')
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
program
|
program
|
||||||
|
Loading…
Reference in New Issue
Block a user