Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small change to worker_base.py #1575

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions workers/worker_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,20 @@ def register_task_completion(self, task, repo_id, model):
'repo_id': repo_id,
'job_model': model
}
key = 'github_url' if 'github_url' in task['given'] else 'git_url' if 'git_url' in task['given'] else \
'gitlab_url' if 'gitlab_url' in task['given'] else 'INVALID_GIVEN'
task_completed[key] = task['given']['github_url'] if 'github_url' in task['given'] else task['given']['git_url'] \
if 'git_url' in task['given'] else task['given']['gitlab_url'] if 'gitlab_url' in task['given'] else 'INVALID_GIVEN'
if key == 'INVALID_GIVEN':

key = None
if 'github_url' in task['given']:
key = 'github_url'
elif 'git_url' in task['given']:
key = 'git_url'
elif 'gitlab_url' in task['given']:
key = 'gitlab_url'
else:
self.register_task_failure(task, repo_id, "INVALID_GIVEN: Not a github/gitlab/git url.")
return

task_completed[key] = task['given'][key]

# Add to history table
task_history = {
'repo_id': repo_id,
Expand Down