Skip to content

Commit fcc648f

Browse files
author
Diego Ardila
committed
reduced polling interval and tested against prod
1 parent 3eecdd7 commit fcc648f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nucleus/job.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import requests
66

7+
JOB_POLLING_INTERVAL = 5
8+
79

810
@dataclass
911
class AsyncJob:
@@ -26,10 +28,12 @@ def errors(self) -> List[str]:
2628

2729
def sleep_until_complete(self, verbose_std_out=True):
2830
while 1:
29-
time.sleep(1)
3031
status = self.status()
32+
33+
time.sleep(JOB_POLLING_INTERVAL)
34+
3135
if verbose_std_out:
32-
print(status)
36+
print(f"Status at {time.ctime()}: {status}")
3337
if status["status"] == "Running":
3438
continue
3539
break

0 commit comments

Comments
 (0)