MCPcopy Create free account
hub / github.com/adobe/Marinus / __check_job_exists

Method __check_job_exists

python3_cron_scripts/libs3/JobsManager.py:74–89  ·  view source on GitHub ↗

Verify that the job name exists in the collection. If the job does not exist, this will create it.

(self, job_name)

Source from the content-addressed store, hash-verified

72 self._job_name = job_name
73
74 def __check_job_exists(self, job_name):
75 """
76 Verify that the job name exists in the collection.
77 If the job does not exist, this will create it.
78 """
79 if (
80 self._mongo_connector.perform_count(
81 self._jobs_collection, {"job_name": job_name}
82 )
83 == 0
84 ):
85 now = datetime.now()
86 self._mongo_connector.perform_insert(
87 self._jobs_collection,
88 {"job_name": job_name, "status": self.NOT_RUN, "updated": now},
89 )
90
91 def create_job(self, job_name):
92 """

Callers 4

create_jobMethod · 0.95
record_job_startMethod · 0.95
record_job_errorMethod · 0.95
record_job_completeMethod · 0.95

Calls 2

perform_countMethod · 0.80
perform_insertMethod · 0.80

Tested by

no test coverage detected