mirror of
https://github.com/aljazceru/IngestRSS.git
synced 2026-02-23 07:04:32 +01:00
Merge pull request #6 from aljazceru/codex/create-local-scheduler-service-with-cron-like-functionality
Implement local scheduler service
This commit is contained in:
@@ -10,3 +10,4 @@ tqdm
|
||||
prometheus-clien
|
||||
redis
|
||||
minio
|
||||
schedule==1.*
|
||||
|
||||
0
src/local/__init__.py
Normal file
0
src/local/__init__.py
Normal file
17
src/local/scheduler.py
Normal file
17
src/local/scheduler.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import schedule
|
||||
import time
|
||||
from src.infra.lambdas.RSSQueueFiller.lambda.lambda_function import handler
|
||||
|
||||
|
||||
def run_queue_filler():
|
||||
"""Invoke the queue filler lambda logic."""
|
||||
handler(None, None)
|
||||
|
||||
|
||||
schedule.every(4).hours.do(run_queue_filler)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
while True:
|
||||
schedule.run_pending()
|
||||
time.sleep(1)
|
||||
Reference in New Issue
Block a user