MCPcopy Index your code
hub / github.com/diffgram/diffgram / job_resync_core

Function job_resync_core

default/methods/task/task_template/job_resync.py:50–74  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

48
49
50def 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
77def threaded_job_resync(task_template_id, member_id):

Callers 2

test_job_resync_coreMethod · 0.90
job_resync_apiFunction · 0.85

Calls 2

get_by_idMethod · 0.45
startMethod · 0.45

Tested by 1

test_job_resync_coreMethod · 0.72