Skip to content

Commit

Permalink
Merge pull request #61 from bukosabino/develop-fix-schedules3
Browse files Browse the repository at this point in the history
Fix schedule jobs to use just one initialization
  • Loading branch information
bukosabino authored Feb 5, 2024
2 parents e4cafa5 + 5991fb3 commit e45a181
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/etls/jobs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import time

import schedule

from src.etls.boe.load import today as boe_today
from src.etls.bopz.load import today as bopz_today
from src.etls.bocm.load import today as bocm_today
from src.initialize import initialize_app


INIT_OBJECTS = initialize_app()


schedule.every().day.at("11:00").do(boe_today, init_objects=INIT_OBJECTS)
schedule.every().day.at("11:05").do(bopz_today, init_objects=INIT_OBJECTS)
schedule.every().day.at("11:10").do(bocm_today, init_objects=INIT_OBJECTS)
# TODO: monthly jobs

while True:
schedule.run_pending()
time.sleep(1)

0 comments on commit e45a181

Please sign in to comment.