androlyze.celery package¶
Subpackages¶
Submodules¶
androlyze.celery.CeleryConstants module¶
androlyze.celery.CeleryUtil module¶
-
androlyze.celery.CeleryUtil.
exp_backoff
(task, _max=64)[source]¶ Use exponential backoff for task retrying.
wait_time = 2^1,..., 2^n limit by _max.
Parameters: task : celery.app.task.Task
_max : int, optional (default is 64)
Maximum time to use.
-
androlyze.celery.CeleryUtil.
get_completed_tasks
(group_result, total_cnt, tasks_per_chunk=1)[source]¶ Get number of completed tasks from group_result.
Parameters: group_result : GroupResult
total_cnt : int
Number of total tasks.
tasks_per_chunk : int, optional (default is 1)
Number of chunks the work is divided into.
-
androlyze.celery.CeleryUtil.
get_successful_analyze_task_results
(group_result, chunked=False)[source]¶ Get results for successful tasks from group_result (meaning their results) and ignore revoked ones.
Parameters: group_result : GroupResult
chunked : bool, optional (default is False)
If work has been divided into chunks.
Returns: list< tuple<id, gridfs (bool)>>
-
androlyze.celery.CeleryUtil.
get_workers_and_check_network
()[source]¶ Get the celery workers and check network.
Returns: str
List of workers as str.
Raises: NetworkError
-
androlyze.celery.CeleryUtil.
join_native
(result_group, timeout=None, propagate=True, interval=0.5, callback=None)[source]¶ Same as :py:method:`GroupResult.join_native` but delivers task meta too. Not just the result!
-
androlyze.celery.CeleryUtil.
write_analyze_task_results_to_fs
(storage, group_result, chunked=False)[source]¶ Get successful task results and write them to disk if enabled.
Parameters: storage: RedundantStorage
group_result : GroupResult
chunked : bool, optional (default is False)
If work has been divided into chunks.
Returns: int
Number of successful tasks