zrb 0.0.42__py3-none-any.whl → 0.0.43__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.
- zrb/task/base_task.py +10 -7
- {zrb-0.0.42.dist-info → zrb-0.0.43.dist-info}/METADATA +1 -1
- {zrb-0.0.42.dist-info → zrb-0.0.43.dist-info}/RECORD +6 -6
- {zrb-0.0.42.dist-info → zrb-0.0.43.dist-info}/LICENSE +0 -0
- {zrb-0.0.42.dist-info → zrb-0.0.43.dist-info}/WHEEL +0 -0
- {zrb-0.0.42.dist-info → zrb-0.0.43.dist-info}/entry_points.txt +0 -0
zrb/task/base_task.py
CHANGED
@@ -71,8 +71,9 @@ class BaseTask(TaskModel):
|
|
71
71
|
self.checkers = checkers
|
72
72
|
self.checking_interval = checking_interval
|
73
73
|
self.skip_execution = skip_execution
|
74
|
-
self.
|
75
|
-
self.
|
74
|
+
self._is_check_triggered: bool = False
|
75
|
+
self._is_execution_triggered: bool = False
|
76
|
+
self._is_execution_started: bool = False
|
76
77
|
self._run_function: Optional[Callable[..., Any]] = run
|
77
78
|
self._args: List[Any] = []
|
78
79
|
self._kwargs: Mapping[str, Any] = {}
|
@@ -214,12 +215,12 @@ class BaseTask(TaskModel):
|
|
214
215
|
print(colored(f'{colored_label}{colored_run_cmd}'), file=sys.stderr)
|
215
216
|
|
216
217
|
async def _cached_check(self) -> bool:
|
217
|
-
if self.
|
218
|
+
if self._is_check_triggered:
|
218
219
|
self.log_debug('Skip checking, because checking flag has been set')
|
219
220
|
return True
|
220
221
|
check_result = await self._check()
|
221
222
|
if check_result:
|
222
|
-
self.
|
223
|
+
self._is_check_triggered = True
|
223
224
|
self.log_debug('Set checking flag to True')
|
224
225
|
return check_result
|
225
226
|
|
@@ -232,7 +233,7 @@ class BaseTask(TaskModel):
|
|
232
233
|
'''
|
233
234
|
if len(self.checkers) == 0:
|
234
235
|
return await self.check()
|
235
|
-
while not self.
|
236
|
+
while not self._is_execution_started:
|
236
237
|
await asyncio.sleep(0.1)
|
237
238
|
check_coroutines: Iterable[asyncio.Task] = []
|
238
239
|
for checker_task in self.checkers:
|
@@ -258,11 +259,11 @@ class BaseTask(TaskModel):
|
|
258
259
|
return results[-1]
|
259
260
|
|
260
261
|
async def _cached_run(self, *args: Any, **kwargs: Any) -> Any:
|
261
|
-
if self.
|
262
|
+
if self._is_execution_triggered:
|
262
263
|
self.log_debug('Skip execution because execution flag is True')
|
263
264
|
return
|
264
265
|
self.log_debug('Set execution flag to True')
|
265
|
-
self.
|
266
|
+
self._is_execution_triggered = True
|
266
267
|
self.log_debug('Start running')
|
267
268
|
# get upstream checker
|
268
269
|
upstream_check_processes: Iterable[asyncio.Task] = []
|
@@ -272,6 +273,8 @@ class BaseTask(TaskModel):
|
|
272
273
|
))
|
273
274
|
# wait all upstream checkers to complete
|
274
275
|
await asyncio.gather(*upstream_check_processes)
|
276
|
+
# mark execution as started, so that checkers can start checking
|
277
|
+
self._is_execution_started = True
|
275
278
|
if self.render_bool(self.skip_execution):
|
276
279
|
self.log_info(
|
277
280
|
f'Skip execution because config: {self.skip_execution}'
|
@@ -216,7 +216,7 @@ zrb/helper/string/double_quote.py,sha256=uYIdgotgVvMWxffJhrgb1TQI5v1-QdA0UByE2xG
|
|
216
216
|
zrb/helper/string/parse_replacement.py,sha256=g4GHaZqncBIZyyZrcZJtylz6gySEU18A27S4XPTEDEI,222
|
217
217
|
zrb/task/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
218
218
|
zrb/task/base_model.py,sha256=kOmiw1hIIcSIbyEBhiJxcg4yZvoTU6pR8Bh4_rY7qgU,14763
|
219
|
-
zrb/task/base_task.py,sha256=
|
219
|
+
zrb/task/base_task.py,sha256=BnyvhDlyMxHGGsdIIrQVbDvuMSXsD3ooqaOrbvqygsI,12462
|
220
220
|
zrb/task/cmd_task.py,sha256=34y3VPfUk0zWYbrEPVonE4w4Kz8Ro7k9ucpviD37zhE,8057
|
221
221
|
zrb/task/decorator.py,sha256=bTN0sNdgy7SeUIIuKtIsxQXhY2s9V79JWbgbMHnOH40,1571
|
222
222
|
zrb/task/docker_compose_task.py,sha256=vZWYVj5mNMg0mD8cg7C8qm0vUCnmqvt22Vzeryx4Ngs,4996
|
@@ -245,8 +245,8 @@ zrb/task_input/input.py,sha256=I4KrdJR3muxAWgd8zX6CErogHYcFM80Si0DmC5-YJGE,69
|
|
245
245
|
zrb/task_input/int_input.py,sha256=YTxeRvHGe60hUto3vGtjA3GVLsR2zPtlIca20XO_94A,1568
|
246
246
|
zrb/task_input/password_input.py,sha256=-ygMqy3JoHtZB5aA7uwlwgntFBJKBasfP3eX9iaOxKE,1521
|
247
247
|
zrb/task_input/str_input.py,sha256=RUw5zTUDAo1kyl5kcUpXyk073xh09N04D41PmH76RVk,1568
|
248
|
-
zrb-0.0.
|
249
|
-
zrb-0.0.
|
250
|
-
zrb-0.0.
|
251
|
-
zrb-0.0.
|
252
|
-
zrb-0.0.
|
248
|
+
zrb-0.0.43.dist-info/entry_points.txt,sha256=xTgXc1kBKYhJHEujdaSPHUcJT3-hbyP1mLgwkv-5sSk,40
|
249
|
+
zrb-0.0.43.dist-info/LICENSE,sha256=hVM_U_SOdNZ9mLpaAZ5qn3HRXQXucGX9rliGPEifzVs,1073
|
250
|
+
zrb-0.0.43.dist-info/WHEEL,sha256=rSgq_JpHF9fHR1lx53qwg_1-2LypZE_qmcuXbVUq948,81
|
251
|
+
zrb-0.0.43.dist-info/METADATA,sha256=0DgCLg8YZxDz3Ur0MJxdordE4qL9ZHWE_9JnjhzVbPc,12335
|
252
|
+
zrb-0.0.43.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|