diff --git a/sen2chain/jobs.py b/sen2chain/jobs.py index 277a53debfe046301f58f9e1d86466d6fc233eb3..ee9f923ed2633d7ea2ea288dce4612f4d1435fea 100644 --- a/sen2chain/jobs.py +++ b/sen2chain/jobs.py @@ -133,7 +133,7 @@ class Job: """ # 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._config_path = Config()._JOBS_DIR / ("job_" + jid + ".cfg") self._python_script_path = Config()._JOBS_DIR / ("job_" + jid + ".py") @@ -157,8 +157,8 @@ class Job: else: logger.info("Creating new job...") self.init() - self._cron = CronTab(user=True) - self.cron_status = self.get_cron_status() + self._cron = CronTab(user=True) if with_cron else None + self.cron_status = self.get_cron_status() if with_cron else None self._log_folder_path = Path(Config().get("log_path")) / ("job_" + jid) self.remove_used_l1c = False