mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 19:58:09 +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
|
||||
.command('rebuild-elastic <workspace>')
|
||||
.command('rebuild-elastic [workspace]')
|
||||
.description('rebuild elastic index')
|
||||
.action(async (workspace, cmd) => {
|
||||
await rebuildElastic(mongodbUri, workspace, minio, elasticUrl)
|
||||
console.log('rebuild end')
|
||||
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)
|
||||
console.log('rebuild end')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
program
|
||||
|
Loading…
Reference in New Issue
Block a user