mirror of
https://github.com/tgbot-collection/ytdlbot.git
synced 2025-02-26 00:05:32 +08:00
extend auto restart time
This commit is contained in:
parent
3fb3dd614d
commit
61c02be8e1
3 changed files with 3 additions and 3 deletions
|
@ -468,7 +468,7 @@ if __name__ == "__main__":
|
|||
threading.Thread(target=run_celery, daemon=True).start()
|
||||
|
||||
scheduler = BackgroundScheduler(timezone="Asia/Shanghai")
|
||||
scheduler.add_job(auto_restart, "interval", seconds=10)
|
||||
scheduler.add_job(auto_restart, "interval", seconds=900)
|
||||
scheduler.start()
|
||||
|
||||
idle()
|
||||
|
|
|
@ -185,7 +185,7 @@ class Detector:
|
|||
def idle_detector(self):
|
||||
mtime = os.stat("/var/log/ytdl.log").st_mtime
|
||||
cur_ts = time.time()
|
||||
if cur_ts - mtime > 1800:
|
||||
if cur_ts - mtime > 7200:
|
||||
logging.warning("Potential crash detected by %s, it's time to commit suicide...", self.func_name())
|
||||
return True
|
||||
|
||||
|
|
|
@ -463,7 +463,7 @@ if __name__ == "__main__":
|
|||
MySQL()
|
||||
scheduler = BackgroundScheduler(timezone="Asia/Shanghai", job_defaults={"max_instances": 5})
|
||||
scheduler.add_job(redis.reset_today, "cron", hour=0, minute=0)
|
||||
scheduler.add_job(auto_restart, "interval", seconds=60)
|
||||
scheduler.add_job(auto_restart, "interval", seconds=600)
|
||||
scheduler.add_job(clean_tempfile, "interval", seconds=60)
|
||||
scheduler.add_job(InfluxDB().collect_data, "interval", seconds=60)
|
||||
# default quota allocation of 10,000 units per day
|
||||
|
|
Loading…
Reference in a new issue