22 lines
449 B
Python
22 lines
449 B
Python
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
from time import sleep
|
|
|
|
from src.utils import load_config, next_cron_match
|
|
|
|
|
|
def main():
|
|
# a place holder
|
|
print("Hello from arxiv-bot!")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
config = load_config()
|
|
crontab = config["general"]["crontab"]
|
|
|
|
while True:
|
|
next_run = next_cron_match(crontab, datetime.now())
|
|
sleep(max((next_run - datetime.now()).total_seconds(), 0.0))
|
|
main()
|