backend.actions¶
-
class
backend.actions.
Action
(opts, action, log=None)[source]¶ Object to send data back to fronted
- Parameters
frontent_callback (backend.callback.FrontendCallback) – object to post data back to frontend
destdir – filepath with build results
action (dict) – dict-like object with action task
Expected action keys:
action_type: main field determining what action to apply
# TODO: describe actions
-
class
backend.actions.
ActionType
[source]¶ -
DELETE
= 0¶
-
RENAME
= 1¶
-
LEGAL_FLAG
= 2¶
-
CREATEREPO
= 3¶
-
UPDATE_COMPS
= 4¶
-
GEN_GPG_KEY
= 5¶
-
RAWHIDE_TO_RELEASE
= 6¶
-
FORK
= 7¶
-
UPDATE_MODULE_MD
= 8¶
-
BUILD_MODULE
= 9¶
-
CANCEL_BUILD
= 10¶
-
-
class
backend.actions.
ActionWorkerManager
(redis_connection=None, max_workers=8, log=None)[source]¶ -
frontend_client
= None¶
-
worker_prefix
= 'action_worker'¶
-
start_task
(worker_id, task)[source]¶ Start background job using the ‘task’ object taken from the ‘tasks’ queue. The background task should _on its own_ and ASAP let the manager know that it successfully started (e.g. mark the job ‘started’ in redis DB), so the has_worker_started() method later gives us valid info.
-
has_worker_ended
(worker_id, task_info)[source]¶ Check ‘task_info’ (dictionary output from redis) whether the task is already finished by worker. If yes, do whatever is needed with the result (contact frontend) and return True. If the task is still processed, return False.
-