mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
Fix setup index delay issue
This commit is contained in:
parent
ab88055ffe
commit
4cf67db6a3
1 changed files with 11 additions and 1 deletions
|
@ -19,7 +19,7 @@ const createProject = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const addPlatform = async (hostname : string) => {
|
||||
const addPlatform = async (hostname: string) => {
|
||||
await api().post("/projects/pingvin-share/platforms", {
|
||||
type: "web",
|
||||
name: "Pingvin Share Web Frontend",
|
||||
|
@ -69,7 +69,17 @@ const createCollections = async () => {
|
|||
);
|
||||
}
|
||||
}
|
||||
// Wait until the indexes are created
|
||||
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(
|
||||
collection.$id,
|
||||
index.key,
|
||||
|
|
Loading…
Add table
Reference in a new issue