Remove depreciated scheduler from tasks

This commit is contained in:
Andrew 2022-01-11 21:56:37 -05:00
parent 79e33cd295
commit 3acc89c0eb
2 changed files with 11 additions and 12 deletions

View File

@ -251,17 +251,16 @@ class TasksManager:
# one for now, # one for now,
self.controller.stats.record_stats() self.controller.stats.record_stats()
# one for later # one for later
schedule.every(stats_update_frequency).seconds.do(self.controller.stats.record_stats).tag('stats-recording') self.scheduler.add_job(self.controller.stats.record_stats, 'interval', seconds=stats_update_frequency, id="stats")
@staticmethod
def serverjar_cache_refresher(): def serverjar_cache_refresher(self):
logger.info("Refreshing serverjars.com cache on start") logger.info("Refreshing serverjars.com cache on start")
server_jar_obj.refresh_cache() server_jar_obj.refresh_cache()
logger.info("Scheduling Serverjars.com cache refresh service every 12 hours") logger.info("Scheduling Serverjars.com cache refresh service every 12 hours")
schedule.every(12).hours.do(server_jar_obj.refresh_cache).tag('serverjars') self.scheduler.add_job(server_jar_obj.refresh_cache, 'interval', hours=12, id="serverjars")
@staticmethod @staticmethod
def realtime(): def realtime():
@ -293,5 +292,5 @@ class TasksManager:
def log_watcher(self): def log_watcher(self):
self.controller.servers.check_for_old_logs() self.controller.servers.check_for_old_logs()
schedule.every(6).hours.do(lambda: self.controller.servers.check_for_old_logs()).tag('log-mgmt') self.scheduler.add_job(self.controller.servers.check_for_old_logs, 'interval', hours=6, id="log-mgmt")

View File

@ -43,12 +43,12 @@
<table class="table table-hover" width="100%" style="table-layout:fixed;"> <table class="table table-hover" width="100%" style="table-layout:fixed;">
<thead> <thead>
<tr class="rounded"> <tr class="rounded">
<th style="width: 25%;">Action</th> <th style="width: 25%; min-width: 50px;">Action</th>
<th style="max-width: 40%;">Command</th> <th style="max-width: 40%; min-width: 50px;">Command</th>
<th style="width: 10%;">Interval</th> <th style="width: 10%; min-width: 50px;">Interval</th>
<th style="width: 10%;">Start Time</th> <th style="width: 10%; min-width: 50px;">Start Time</th>
<th style="width: 10%;">Enabled</th> <th style="width: 10%; min-width: 50px;">Enabled</th>
<th style="width: 10%;">Edit</th> <th style="width: 10%; min-width: 50px;">Edit</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>