aboutsummaryrefslogtreecommitdiffstats
path: root/cron
diff options
context:
space:
mode:
Diffstat (limited to 'cron')
-rw-r--r--cron/hourly.py7
-rwxr-xr-xcron/requirements.txt2
2 files changed, 8 insertions, 1 deletions
diff --git a/cron/hourly.py b/cron/hourly.py
index daf46ec..89a6027 100644
--- a/cron/hourly.py
+++ b/cron/hourly.py
@@ -3,12 +3,14 @@ import sys
sys.path.insert(1, os.path.join(os.path.dirname(__file__), ".."))
+from matplotlib.ticker import EngFormatter
from discord_webhook import DiscordWebhook
from operator import itemgetter
import subprocess
import subreddit
import database
import datetime
+import time
def dump():
subprocess.run(["rm", "-fv", "/tmp/*.sql*"])
@@ -38,6 +40,11 @@ def push(fp = "/tmp/sytc_nolog.sql.gz"):
subreddit.display(str(response))
if __name__ == "__main__":
+ fmt = EngFormatter("B")
+ starttime = time.time()
dump()
+ subreddit.display("\n\nDumped %s in %.1fs\n" % (fmt(os.path.getsize("/tmp/sytc_nolog.sql.gz")), time.time() - starttime))
+ starttime = time.time()
push()
+ subreddit.display("Pushed to discord in %.2fs\n" % (time.time() - starttime))
diff --git a/cron/requirements.txt b/cron/requirements.txt
index f2c4fc9..86f552b 100755
--- a/cron/requirements.txt
+++ b/cron/requirements.txt
@@ -1,3 +1,3 @@
numpy==1.26.4
-# matplotlib
+matplotlib
discord-webhook