extend auto restart time

This commit is contained in:
Benny 2023-04-08 16:29:39 +02:00
parent 3fb3dd614d
commit 61c02be8e1
No known key found for this signature in database
GPG key ID: 6CD0DBDA5235D481
3 changed files with 3 additions and 3 deletions

View file

@ -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()

View file

@ -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

View file

@ -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