mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-11 02:38:49 +00:00
Merge remote-tracking branch 'origin/develop' into staging
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
commit
bc3cf5ef19
@ -867,6 +867,10 @@ export async function listWorkspaces (
|
||||
): Promise<WorkspaceInfo[]> {
|
||||
decodeToken(ctx, token) // Just verify token is valid
|
||||
|
||||
if (region === '') {
|
||||
region = null
|
||||
}
|
||||
|
||||
return (await db.workspace.find(region != null ? { region } : {}))
|
||||
.filter((it) => it.disabled !== true)
|
||||
.map(trimWorkspaceInfo)
|
||||
@ -903,6 +907,9 @@ export async function countWorkspacesInRegion (
|
||||
* @public
|
||||
*/
|
||||
export async function listWorkspacesRaw (db: AccountDB, region?: string): Promise<Workspace[]> {
|
||||
if (region === '') {
|
||||
region = undefined
|
||||
}
|
||||
return (await db.workspace.find(region !== undefined ? { region } : {})).filter((it) => it.disabled !== true)
|
||||
}
|
||||
|
||||
|
@ -1652,6 +1652,7 @@ export async function restore (
|
||||
storageAdapter?: StorageAdapter
|
||||
token?: string
|
||||
progress?: (progress: number) => Promise<void>
|
||||
cleanIndexState?: boolean
|
||||
}
|
||||
): Promise<boolean> {
|
||||
const infoFile = 'backup.json.gz'
|
||||
@ -1845,6 +1846,11 @@ export async function restore (
|
||||
tx.objectSpace = core.space.Workspace
|
||||
}
|
||||
}
|
||||
if (opt.cleanIndexState === true) {
|
||||
if (d._class === core.class.DocIndexState) {
|
||||
;(d as DocIndexState).needIndex = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (opt.recheck === true) {
|
||||
|
@ -347,13 +347,8 @@ export async function doRestoreWorkspace (
|
||||
bucketName: string,
|
||||
pipelineFactory: PipelineFactory,
|
||||
workspaceStorageAdapter: StorageAdapter,
|
||||
getConfig: (
|
||||
ctx: MeasureContext,
|
||||
workspace: WorkspaceIdWithUrl,
|
||||
branding: Branding | null,
|
||||
externalStorage: StorageAdapter
|
||||
) => DbConfiguration,
|
||||
skipDomains: string[],
|
||||
cleanIndexState: boolean,
|
||||
notify?: (progress: number) => Promise<void>
|
||||
): Promise<boolean> {
|
||||
rootCtx.warn('\nRESTORE WORKSPACE ', {
|
||||
@ -374,6 +369,7 @@ export async function doRestoreWorkspace (
|
||||
skip: new Set(skipDomains),
|
||||
recheck: true,
|
||||
storageAdapter: workspaceStorageAdapter,
|
||||
cleanIndexState,
|
||||
getConnection: async () => {
|
||||
if (pipeline === undefined) {
|
||||
pipeline = await pipelineFactory(ctx, wsUrl, true, () => {}, null)
|
||||
|
@ -530,13 +530,8 @@ export class WorkspaceWorker {
|
||||
opt.backup.bucketName,
|
||||
pipelineFactory,
|
||||
workspaceStorageAdapter,
|
||||
(ctx, workspace, branding, externalStorage) => {
|
||||
return getConfig(ctx, dbUrl, ctx, {
|
||||
externalStorage,
|
||||
disableTriggers: true
|
||||
})
|
||||
},
|
||||
['blob'],
|
||||
true,
|
||||
(_p: number) => {
|
||||
if (progress !== Math.round(_p)) {
|
||||
progress = Math.round(_p)
|
||||
|
Loading…
Reference in New Issue
Block a user