Compare commits
2 Commits
f8e06fb9c0
...
39999f5128
Author | SHA1 | Date |
---|---|---|
simon | 39999f5128 | |
simon | ee61496ecb |
|
@ -92,7 +92,11 @@ def chart_fill(plt, y_ticks):
|
|||
}
|
||||
|
||||
for tick in y_ticks[0:-1]:
|
||||
match = key_map[tick]
|
||||
if tick > 300:
|
||||
match = key_map[300]
|
||||
else:
|
||||
match = key_map[tick]
|
||||
|
||||
plt.axhspan(
|
||||
match["low"], match["high"], facecolor=match["color"], zorder=0
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
""" main entry page to handle all the routes """
|
||||
|
||||
import os
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from flask import Flask, render_template, request, app
|
||||
from flask import url_for # pylint: disable=unused-import
|
||||
|
@ -51,11 +51,9 @@ if not is_maintenance_mode:
|
|||
print('initial export')
|
||||
current_graph()
|
||||
nightly_graph()
|
||||
monthly_graph()
|
||||
|
||||
# start scheduler
|
||||
timezone = os.environ.get("TZ")
|
||||
scheduler = BackgroundScheduler(timezone=timezone)
|
||||
scheduler = BackgroundScheduler(timezone=os.environ.get("TZ", "UTC"))
|
||||
scheduler.add_job(
|
||||
current_graph, trigger="cron", minute='*/5', name='current_graph'
|
||||
)
|
||||
|
@ -65,6 +63,9 @@ if not is_maintenance_mode:
|
|||
scheduler.add_job(
|
||||
monthly_graph, trigger="cron", day='*', hour='1', minute='2', name='month'
|
||||
)
|
||||
scheduler.add_job(
|
||||
monthly_graph, next_run_time=datetime.now() + timedelta(seconds=10)
|
||||
)
|
||||
scheduler.start()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue