Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
edulix committed May 1, 2024
1 parent 9a40674 commit 8073e79
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frestq/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def decorator(view_func):
wrapper_func = view_func
else:
def wrapper_func(*args, **kwargs):
print(f"task: Starting task\n\n")
print(f"task: Starting task")
ret = view_func(*args, **kwargs)
print(f"task: Finished task\n\n")
print(f"task: Finished task")
return ret

ActionHandlers.add_action_handler(action, queue, wrapper_func, kwargs)
Expand Down Expand Up @@ -99,9 +99,9 @@ def __call__(self, *args):
if certs_differ(sender_ssl_cert, local_ssl_cert):
raise SecurityException()

print(f"local_task: Starting task.id={task.task_model.id}\n\n")
print(f"local_task: Starting task.id={task.task_model.id}")
ret = self.func(*args)
print(f"local_task: Finished task.id={task.task_model.id}\n\n")
print(f"local_task: Finished task.id={task.task_model.id}")
return ret

def internal_task(name, **kwargs):
Expand Down
5 changes: 5 additions & 0 deletions frestq/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def update_task(msg):
raise SecurityException()

keys = ['output_data', 'status']

for key in keys:
if key not in msg.input_data:
continue
Expand All @@ -94,6 +95,10 @@ def update_task(msg):
f"({task.id}) **NOT** SETTING TASK FIELD '{key}' to "
f"'{str_data}' because it's already 'finished'"
)
# do next (it might be a task with a parent task)
receiver_task = BaseTask.instance_by_model(task)
receiver_task.execute()
return
else:
logging.debug(
f"({task.id}) SETTING TASK FIELD '{key}' to '{str_data}'"
Expand Down

0 comments on commit 8073e79

Please sign in to comment.