fix demo retries
authorRadek Czajka <rczajka@rczajka.pl>
Tue, 10 Oct 2023 09:15:39 +0000 (11:15 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Tue, 10 Oct 2023 09:15:39 +0000 (11:15 +0200)
src/depot/publishers/woblink.py

index f77d618..c3ec7a5 100644 (file)
@@ -565,6 +565,12 @@ class Woblink(BasePublisher):
             ).json()['jobId']
             try:
                 file_id = self.wait_for_job(job_id)
             ).json()['jobId']
             try:
                 file_id = self.wait_for_job(job_id)
+                if check:
+                    self.wait_for_job(
+                        self.session.get(
+                            self.CHECK_DEMO_URL % (file_format, woblink_id)
+                        ).json()['jobId']
+                    )
             except AssertionError:
                 if percent < 50:
                     percent += 10
             except AssertionError:
                 if percent < 50:
                     percent += 10
@@ -573,12 +579,6 @@ class Woblink(BasePublisher):
             else:
                 break
 
             else:
                 break
 
-        if check:
-            self.wait_for_job(
-                self.session.get(
-                    self.CHECK_DEMO_URL % (file_format, woblink_id)
-                ).json()['jobId']
-            )
         return file_id
 
     def send_epub(self, woblink_id, doc, gallery_path, fundraising=None):
         return file_id
 
     def send_epub(self, woblink_id, doc, gallery_path, fundraising=None):