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

add a force checkup for file status in case of mercure dysfunctionnement

Olivier Massot 2 роки тому
батько
коміт
688f98d569
1 змінених файлів з 10 додано та 0 видалено
  1. 10 0
      pages/cmf_licence_structure.vue

+ 10 - 0
pages/cmf_licence_structure.vue

@@ -94,6 +94,16 @@ const submit = async () => {
     // SSE will update its status to ready when it'll be.
     await em.fetch(File, receipt.fileId)
 
+    // In the case of a SSE dysfonctionnement, program a forced checkup of file status
+    for (let i = 0; i < 3; i++) {
+      setTimeout(async () => {
+        if (file.value && file.value.status === 'PENDING') {
+          console.warn("File's status has not been updated : force a status checkup")
+          await em.fetch(File, receipt.fileId, true)
+        }
+      }, i * 4000)
+    }
+
   } finally {
     submitting.value = false
   }