Skip to content
Snippets Groups Projects
Commit bc6b9b9a authored by Manon Blanco's avatar Manon Blanco Committed by Yoann Schneider
Browse files

Use `is_read_only` to allow/forbid to update Worker Activity

parent 5dd605a6
No related branches found
Tags 0.3.1-beta1
1 merge request!387Use `is_read_only` to allow/forbid to update Worker Activity
Pipeline #129779 passed
...@@ -136,7 +136,7 @@ class ElementsWorker( ...@@ -136,7 +136,7 @@ class ElementsWorker(
Whether or not WorkerActivity support has been enabled on the DataImport Whether or not WorkerActivity support has been enabled on the DataImport
used to run this worker. used to run this worker.
""" """
if self.args.dev: if self.is_read_only:
return False return False
assert ( assert (
self.process_information self.process_information
...@@ -278,10 +278,6 @@ class ElementsWorker( ...@@ -278,10 +278,6 @@ class ElementsWorker(
), "element_id shouldn't be null and should be an UUID or str" ), "element_id shouldn't be null and should be an UUID or str"
assert isinstance(state, ActivityState), "state should be an ActivityState" assert isinstance(state, ActivityState), "state should be an ActivityState"
if self.is_read_only:
logger.warning("Cannot update activity as this worker is in read-only mode")
return True
try: try:
self.request( self.request(
"UpdateWorkerActivity", "UpdateWorkerActivity",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment