Переглянути джерело

possible fix for too many races

hmt 3 роки тому
батько
коміт
c6abdce969
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      app.ts

+ 2 - 2
app.ts

@@ -15,9 +15,9 @@ router.all('/create', async (req, res, next) => {
   const existing_id = queue[meeting_id]
   if (existing_id) {
     console.log(`Race pending for meeting-ID: ${Color.red(meeting_id)}`)
-  } else {
-    queue[meeting_id] = deferred<string>();
+    await existing_id
   }
+  queue[meeting_id] = deferred<string>();
   next()
 })
 // the api itself answering to every call