fix(server): commit import not finishing correctly (#2153)
* fix(server): commit import not finishing correctly * awaiting last batch added * minor fix
This commit is contained in:
committed by
GitHub
parent
a489a7bb9a
commit
663eaac5a2
@@ -102,7 +102,7 @@ function useViewerObjectAutoLoading() {
|
||||
viewer.loadObjectAsync(
|
||||
objectUrl,
|
||||
authToken.value || undefined,
|
||||
disableViewerCache ? false : undefined, // TODO: Undo
|
||||
disableViewerCache ? false : undefined,
|
||||
options?.zoomToObject
|
||||
)
|
||||
}
|
||||
|
||||
@@ -564,6 +564,9 @@ const loadAllObjectsFromParent = async (
|
||||
batchPromises = []
|
||||
}
|
||||
}
|
||||
|
||||
// If any remaining promises - await them
|
||||
await Promise.all(batchPromises)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,8 @@ export const retry = async <V = unknown>(fn: () => MaybeAsync<V>, n: number) =>
|
||||
let lastError: Error | undefined
|
||||
for (let i = 0; i < n; i++) {
|
||||
try {
|
||||
return await Promise.resolve(fn())
|
||||
const res = await Promise.resolve(fn())
|
||||
return res
|
||||
} catch (error) {
|
||||
lastError = ensureError(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user