neft_outward
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import time
|
||||
from logging_config import get_logger
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
class Scheduler:
|
||||
def __init__(self, processor, config):
|
||||
self.processor = processor
|
||||
self.config = config
|
||||
|
||||
def run(self):
|
||||
logger.info("Scheduler started")
|
||||
while True:
|
||||
try:
|
||||
self.processor.process()
|
||||
except Exception:
|
||||
logger.exception("Processing cycle failed")
|
||||
|
||||
logger.info(
|
||||
"Sleeping for %s minutes", self.config.poll_interval_minutes
|
||||
)
|
||||
time.sleep(self.config.poll_interval_minutes * 60)
|
||||
``
|
||||
Reference in New Issue
Block a user