mirror of
https://github.com/stonith404/pingvin-share.git
synced 2024-11-05 15:30:14 +01:00
Fix setup index delay issue
This commit is contained in:
parent
ab88055ffe
commit
4cf67db6a3
@ -69,7 +69,17 @@ const createCollections = async () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Wait until the indexes are created
|
||||||
for (const index of indexes) {
|
for (const index of indexes) {
|
||||||
|
const getStatus = async () =>
|
||||||
|
(
|
||||||
|
await aw().database.getAttribute(collection.$id, index.key)
|
||||||
|
).status.toString();
|
||||||
|
|
||||||
|
while ((await getStatus()) == "processing") {
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||||
|
}
|
||||||
|
|
||||||
aw().database.createIndex(
|
aw().database.createIndex(
|
||||||
collection.$id,
|
collection.$id,
|
||||||
index.key,
|
index.key,
|
||||||
|
Loading…
Reference in New Issue
Block a user