port-ocean 0.12.2.dev12__py3-none-any.whl → 0.12.2.dev13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of port-ocean might be problematic. Click here for more details.
- port_ocean/utils/repeat.py +20 -19
- {port_ocean-0.12.2.dev12.dist-info → port_ocean-0.12.2.dev13.dist-info}/METADATA +1 -1
- {port_ocean-0.12.2.dev12.dist-info → port_ocean-0.12.2.dev13.dist-info}/RECORD +6 -6
- {port_ocean-0.12.2.dev12.dist-info → port_ocean-0.12.2.dev13.dist-info}/LICENSE.md +0 -0
- {port_ocean-0.12.2.dev12.dist-info → port_ocean-0.12.2.dev13.dist-info}/WHEEL +0 -0
- {port_ocean-0.12.2.dev12.dist-info → port_ocean-0.12.2.dev13.dist-info}/entry_points.txt +0 -0
port_ocean/utils/repeat.py
CHANGED
|
@@ -61,26 +61,27 @@ def repeat_every(
|
|
|
61
61
|
async def loop() -> None:
|
|
62
62
|
nonlocal repetitions
|
|
63
63
|
|
|
64
|
-
if wait_first:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
raise exc
|
|
64
|
+
# if wait_first:
|
|
65
|
+
# await asyncio.sleep(seconds)
|
|
66
|
+
# count the repetition even if an exception is raised
|
|
67
|
+
repetitions += 1
|
|
68
|
+
try:
|
|
69
|
+
if is_coroutine:
|
|
70
|
+
task = asyncio.create_task(func())
|
|
71
|
+
signal_handler.register(lambda: task.cancel())
|
|
72
|
+
ensure_future(task)
|
|
73
|
+
else:
|
|
74
|
+
run_in_threadpool(func)
|
|
75
|
+
except Exception as exc:
|
|
76
|
+
formatted_exception = "".join(
|
|
77
|
+
format_exception(type(exc), exc, exc.__traceback__)
|
|
78
|
+
)
|
|
79
|
+
logger.error(formatted_exception)
|
|
80
|
+
if raise_exceptions:
|
|
81
|
+
raise exc
|
|
83
82
|
await asyncio.sleep(seconds)
|
|
83
|
+
if max_repetitions is None or repetitions < max_repetitions:
|
|
84
|
+
asyncio.get_event_loop().call_later(seconds, loop)
|
|
84
85
|
|
|
85
86
|
ensure_future(loop())
|
|
86
87
|
|
|
@@ -135,12 +135,12 @@ port_ocean/utils/async_iterators.py,sha256=iw3cUHxfQm3zUSPdw2FmSXDU8E1Ppnys4TGhs
|
|
|
135
135
|
port_ocean/utils/cache.py,sha256=3KItZDE2yVrbVDr-hoM8lNna8s2dlpxhP4ICdLjH4LQ,2231
|
|
136
136
|
port_ocean/utils/misc.py,sha256=0q2cJ5psqxn_5u_56pT7vOVQ3shDM02iC1lzyWQ_zl0,2098
|
|
137
137
|
port_ocean/utils/queue_utils.py,sha256=KWWl8YVnG-glcfIHhM6nefY-2sou_C6DVP1VynQwzB4,2762
|
|
138
|
-
port_ocean/utils/repeat.py,sha256=
|
|
138
|
+
port_ocean/utils/repeat.py,sha256=6acByfRzTXYQMkL9vBLZqvYM0IHV1I6EjfwnvqoWImY,3411
|
|
139
139
|
port_ocean/utils/signal.py,sha256=z9iJBw8aAfxGKwlSHjhEq1g8HbPkCaYpVMyvtisrjZU,1365
|
|
140
140
|
port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
|
|
141
141
|
port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
|
|
142
|
-
port_ocean-0.12.2.
|
|
143
|
-
port_ocean-0.12.2.
|
|
144
|
-
port_ocean-0.12.2.
|
|
145
|
-
port_ocean-0.12.2.
|
|
146
|
-
port_ocean-0.12.2.
|
|
142
|
+
port_ocean-0.12.2.dev13.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
143
|
+
port_ocean-0.12.2.dev13.dist-info/METADATA,sha256=xkoOnVA59qSgE-hgS_eUF_SMyiGB28fOkJg0xJA2k4M,6713
|
|
144
|
+
port_ocean-0.12.2.dev13.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
145
|
+
port_ocean-0.12.2.dev13.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
|
|
146
|
+
port_ocean-0.12.2.dev13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|