mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-20 18:09:56 +00:00
fix not reload job config
This commit is contained in:
parent
b4f985f3dc
commit
4e914d0e2a
@ -84,6 +84,7 @@ class CronService:
|
|||||||
if mtime != self._last_mtime:
|
if mtime != self._last_mtime:
|
||||||
logger.info("Cron: jobs.json modified externally, reloading")
|
logger.info("Cron: jobs.json modified externally, reloading")
|
||||||
self._store = None
|
self._store = None
|
||||||
|
self._last_mtime = mtime
|
||||||
if self._store:
|
if self._store:
|
||||||
return self._store
|
return self._store
|
||||||
|
|
||||||
@ -190,8 +191,7 @@ class CronService:
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.store_path.write_text(json.dumps(data, indent=2, ensure_ascii=False), encoding="utf-8")
|
self.store_path.write_text(json.dumps(data, indent=2, ensure_ascii=False), encoding="utf-8")
|
||||||
self._last_mtime = self.store_path.stat().st_mtime
|
|
||||||
|
|
||||||
async def start(self) -> None:
|
async def start(self) -> None:
|
||||||
"""Start the cron service."""
|
"""Start the cron service."""
|
||||||
self._running = True
|
self._running = True
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user