diff options
| author | jwansek <eddie.atten.ea29@gmail.com> | 2025-11-04 14:05:46 +0000 |
|---|---|---|
| committer | jwansek <eddie.atten.ea29@gmail.com> | 2025-11-04 14:05:46 +0000 |
| commit | af86a9a01c36002d18b9666f470d7a3fce0e533c (patch) | |
| tree | 097ca03e07b9845a360d5c02ce13b6a7c083cf46 /cron/hourly.py | |
| parent | db922ff88310724334495f21db2fa6fe3c16e791 (diff) | |
| download | SmallYTChannelBot-af86a9a01c36002d18b9666f470d7a3fce0e533c.tar.gz SmallYTChannelBot-af86a9a01c36002d18b9666f470d7a3fce0e533c.zip | |
Updated logging on hourly cronjob
Diffstat (limited to 'cron/hourly.py')
| -rw-r--r-- | cron/hourly.py | 7 |
1 files changed, 7 insertions, 0 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)) |
