Given the JOB id, find all the files with no tasks attached to the job, and trigger events to create tasks for them. :param session: :param job_id: :param log: :return:
(session,
project,
member,
task_template_id,
log)
| 48 | |
| 49 | |
| 50 | def job_resync_core(session, |
| 51 | project, |
| 52 | member, |
| 53 | task_template_id, |
| 54 | log): |
| 55 | """ |
| 56 | Given the JOB id, find all the files with no tasks attached to the job, |
| 57 | and trigger events to create tasks for them. |
| 58 | :param session: |
| 59 | :param job_id: |
| 60 | :param log: |
| 61 | :return: |
| 62 | """ |
| 63 | result = True |
| 64 | task_template = Job.get_by_id(session = session, job_id = task_template_id) |
| 65 | if task_template.project_id != project.id: |
| 66 | log['error']['project_id'] = f"Invalid job given for project {project.project_string_id}" |
| 67 | return False, log |
| 68 | |
| 69 | t = threading.Thread( |
| 70 | target = threaded_job_resync, |
| 71 | args = ((task_template_id, member.id))) |
| 72 | t.start() |
| 73 | |
| 74 | return result, log |
| 75 | |
| 76 | |
| 77 | def threaded_job_resync(task_template_id, member_id): |