Skip to content

Commit

Permalink
fix: remove and dump JobManager fields
Browse files Browse the repository at this point in the history
  • Loading branch information
chybz committed Apr 12, 2024
1 parent 121b0a2 commit 9b691fd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 21 deletions.
2 changes: 1 addition & 1 deletion avatars/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file has been generated - DO NOT MODIFY
# API Version : 1.1.0-8143129ddb2381b96eb92a581856bda578d89291
# API Version : 1.1.0-22c97c51f06dc47e6b3f3cdce39be8961d209c9e


import io
Expand Down
2 changes: 1 addition & 1 deletion avatars/api_autogenerated.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file has been generated - DO NOT MODIFY
# API Version : 1.1.0-8143129ddb2381b96eb92a581856bda578d89291
# API Version : 1.1.0-22c97c51f06dc47e6b3f3cdce39be8961d209c9e


import itertools
Expand Down
21 changes: 5 additions & 16 deletions avatars/base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ def call_update_func(info: OperationInfo) -> bool:
return update_func(info)

info = OperationInfo(data=self.data)
last_updated_at = info.last_updated_at
what = str(response_cls) if response_cls else "request"
what_label = f"for {what} at {self.data.url} to complete"
loops = 1
Expand All @@ -366,21 +365,11 @@ def call_update_func(info: OperationInfo) -> bool:
if stop or not info.in_progress:
break

last_updated_duration = (
info.last_updated_at - last_updated_at
).total_seconds()

if last_updated_duration > DEFAULT_TIMEOUT:
raise TimeoutError(f"It took more than {DEFAULT_TIMEOUT}s {what_label}")
else:
last_updated_at = info.last_updated_at
logger.info(
f"waiting {what_label}"
f" (last updated: {info.last_updated_at}"
f", duration {last_updated_duration}"
f", loop {loops}, sleeping {DEFAULT_RETRY_INTERVAL}s)"
)
time.sleep(DEFAULT_RETRY_INTERVAL)
logger.info(
f"waiting {what_label}"
f"(loop {loops}, sleeping {DEFAULT_RETRY_INTERVAL}s)"
)
time.sleep(DEFAULT_RETRY_INTERVAL)

loops += 1

Expand Down
2 changes: 1 addition & 1 deletion avatars/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file has been generated - DO NOT MODIFY
# API Version : 1.1.0-8143129ddb2381b96eb92a581856bda578d89291
# API Version : 1.1.0-22c97c51f06dc47e6b3f3cdce39be8961d209c9e


import sys
Expand Down
4 changes: 2 additions & 2 deletions avatars/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file has been generated - DO NOT MODIFY
# API Version : 1.1.0-8143129ddb2381b96eb92a581856bda578d89291
# API Version : 1.1.0-22c97c51f06dc47e6b3f3cdce39be8961d209c9e


from __future__ import annotations
Expand All @@ -15,7 +15,7 @@

# generated by datamodel-codegen:
# filename: input.json
# timestamp: 2024-04-12T09:39:05+00:00
# timestamp: 2024-04-12T11:39:42+00:00


class AnalysisStatus(Enum):
Expand Down

0 comments on commit 9b691fd

Please sign in to comment.