Fix Scheduler errors with the internal apis
This commit is contained in:
parent
89a3c8b0b6
commit
8b697d87d1
|
@ -62,6 +62,12 @@ class JobScheduler(ApiCaller):
|
|||
def env(self, env: Dict[str, Any]):
|
||||
self.__env = env
|
||||
|
||||
def set_integration(self, integration: str):
|
||||
self.__integration = integration
|
||||
|
||||
def auto_setup(self):
|
||||
super().auto_setup(bw_integration=self.__integration)
|
||||
|
||||
def __get_jobs(self):
|
||||
jobs = {}
|
||||
for plugin_file in glob(
|
||||
|
|
|
@ -201,6 +201,9 @@ if __name__ == "__main__":
|
|||
)
|
||||
dotenv_env = dotenv_values(str(tmp_variables_path))
|
||||
|
||||
# Instantiate scheduler
|
||||
SCHEDULER = JobScheduler(environ.copy(), logger)
|
||||
|
||||
logger.info("Scheduler started ...")
|
||||
|
||||
# Checking if the argument variables is true.
|
||||
|
@ -231,6 +234,10 @@ if __name__ == "__main__":
|
|||
|
||||
del integration_path
|
||||
|
||||
SCHEDULER.set_integration(INTEGRATION)
|
||||
# Automatically setup the scheduler apis
|
||||
SCHEDULER.auto_setup()
|
||||
|
||||
db = Database(
|
||||
logger,
|
||||
sqlalchemy_string=getenv("DATABASE_URI", None),
|
||||
|
@ -370,11 +377,6 @@ if __name__ == "__main__":
|
|||
"Looks like BunkerWeb configuration is already generated, will not GENERATE it again ..."
|
||||
)
|
||||
|
||||
# Instantiate scheduler
|
||||
SCHEDULER = JobScheduler(env.copy() | environ.copy(), logger, INTEGRATION)
|
||||
# Automatically setup the scheduler apis
|
||||
SCHEDULER.auto_setup(bw_integration=INTEGRATION)
|
||||
|
||||
FIRST_RUN = True
|
||||
while True:
|
||||
ret = db.checked_changes()
|
||||
|
|
Loading…
Reference in New Issue