MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / create_job

Method create_job

src/codegraphcontext/core/jobs.py:75–86  ·  view source on GitHub ↗

Creates a new job, assigns it a unique ID, and stores it.

(self, path: str, is_dependency: bool = False)

Source from the content-addressed store, hash-verified

73 self.lock = threading.Lock() # A lock to ensure thread-safe access to the jobs dictionary.
74
75 def create_job(self, path: str, is_dependency: bool = False) -> str:
76 """Creates a new job, assigns it a unique ID, and stores it."""
77 job_id = str(uuid.uuid4())
78 with self.lock:
79 self.jobs[job_id] = JobInfo(
80 job_id=job_id,
81 status=JobStatus.PENDING,
82 start_time=datetime.now(),
83 path=path,
84 is_dependency=is_dependency
85 )
86 return job_id
87
88 def update_job(self, job_id: str, **kwargs):
89 """Updates the information for a specific job in a thread-safe manner."""

Callers 6

test_create_jobMethod · 0.95
add_code_to_graphFunction · 0.80
add_package_to_graphFunction · 0.80
_run_index_with_progressFunction · 0.80
index_fixtureFunction · 0.80

Calls 1

JobInfoClass · 0.85

Tested by 3

test_create_jobMethod · 0.76
index_fixtureFunction · 0.64