Skip to content
Snippets Groups Projects
Commit 1750ec07 authored by George Ge's avatar George Ge
Browse files

remove cron requirement for Job

parent ffd13f50
No related branches found
No related tags found
No related merge requests found
...@@ -133,7 +133,7 @@ class Job: ...@@ -133,7 +133,7 @@ class Job:
""" """
# logger.propagate = False # logger.propagate = False
def __init__(self, jid: str): def __init__(self, jid: str, with_cron: bool = True):
self.false_list = ["", "False", False, None, "None", [], [""], [None], ["None"], [False], ["False"]] self.false_list = ["", "False", False, None, "None", [], [""], [None], ["None"], [False], ["False"]]
self._config_path = Config()._JOBS_DIR / ("job_" + jid + ".cfg") self._config_path = Config()._JOBS_DIR / ("job_" + jid + ".cfg")
self._python_script_path = Config()._JOBS_DIR / ("job_" + jid + ".py") self._python_script_path = Config()._JOBS_DIR / ("job_" + jid + ".py")
...@@ -157,8 +157,8 @@ class Job: ...@@ -157,8 +157,8 @@ class Job:
else: else:
logger.info("Creating new job...") logger.info("Creating new job...")
self.init() self.init()
self._cron = CronTab(user=True) self._cron = CronTab(user=True) if with_cron else None
self.cron_status = self.get_cron_status() self.cron_status = self.get_cron_status() if with_cron else None
self._log_folder_path = Path(Config().get("log_path")) / ("job_" + jid) self._log_folder_path = Path(Config().get("log_path")) / ("job_" + jid)
self.remove_used_l1c = False self.remove_used_l1c = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment