mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
chore: Handle read-only mode in JobScheduler methods
This commit is contained in:
parent
3752e0d989
commit
d85b0ff69c
1 changed files with 3 additions and 3 deletions
|
|
@ -238,6 +238,7 @@ class JobScheduler(ApiCaller):
|
|||
|
||||
err = self.try_database_readonly()
|
||||
if err:
|
||||
self.__logger.error("Database is in read-only mode, pending jobs will not be executed")
|
||||
return True
|
||||
|
||||
self.__job_success = True
|
||||
|
|
@ -278,6 +279,7 @@ class JobScheduler(ApiCaller):
|
|||
def run_once(self, plugins: Optional[List[str]] = None) -> bool:
|
||||
err = self.try_database_readonly()
|
||||
if err:
|
||||
self.__logger.error("Database is in read-only mode, jobs will not be executed")
|
||||
return True
|
||||
|
||||
threads = []
|
||||
|
|
@ -310,6 +312,7 @@ class JobScheduler(ApiCaller):
|
|||
def run_single(self, job_name: str) -> bool:
|
||||
err = self.try_database_readonly()
|
||||
if err:
|
||||
self.__logger.error(f"Database is in read-only mode, single job {job_name} will not be executed")
|
||||
return True
|
||||
|
||||
if self.__lock:
|
||||
|
|
@ -384,7 +387,4 @@ class JobScheduler(ApiCaller):
|
|||
self.db.retry_connection(fallback=True, log=False)
|
||||
self.db.readonly = True
|
||||
|
||||
if self.db.readonly:
|
||||
self.__logger.error("Database is in read-only mode, jobs will not be executed")
|
||||
|
||||
return self.db.readonly
|
||||
|
|
|
|||
Loading…
Reference in a new issue