Selaa lähdekoodia

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

Olivier Massot 2 vuotta sitten
vanhempi
commit
688f98d569
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  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
   }