Skip to content

Commit

Permalink
Merge context_details dict with new values
Browse files Browse the repository at this point in the history
  • Loading branch information
duhow committed Feb 9, 2023
1 parent e0229be commit 70da83c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ def process_workflow_job():
else:
time_to_start = (time_start - datetime.fromtimestamp(job_requested)).seconds

extra_data = {
context_details = {
**context_details,
"time_to_start": time_to_start,
"runner_name": runner_name,
"runner_public": runner_public,
"repository_private": repository_private
}
context_details = {**context_details, **extra_data}

elif action == "completed":
job_requested = jobs.get(job_id)
Expand All @@ -99,11 +99,12 @@ def process_workflow_job():
# delete from memory
del jobs[job_id]

extra_data = {
context_details = {
**context_details,
"time_to_finish": time_to_finish,
"conclusion": conclusion
}
context_details = {**context_details, **extra_data}

else:
app.logger.warning(f"Unknown action {action}, removing from memory")
if job_id in jobs:
Expand Down

0 comments on commit 70da83c

Please sign in to comment.