forked from gauri-sacumen/Connector_First_Repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jobs.py
22 lines (19 loc) · 898 Bytes
/
jobs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from library.constants.messages import(NOTIFICATIONS_COLLECTOR_JOB_STARTED,NOTIFICATIONS_COLLECTOR_JOB_ENDED,NOTIFICATIONS_FILTER_JOB_STARTED ,
NOTIFICATIONS_FILTER_JOB_ENDED
)
from library.init import logger , filter_logger
from library.init import configs
from library.collector.api import collect_notification , apply_filter
# from library.init.scheduler import get_configurations
def notifications_collector_job() -> None:
"""Job to collect notifications from IronAPI
"""
#logger.info(NOTIFICATIONS_COLLECTOR_JOB_STARTED)
collect_notification()
#logger.info(NOTIFICATIONS_COLLECTOR_JOB_ENDED)
def notifications_filter_job() -> None:
"""Job to read notifications from Data queue, filter it and write to Notifications queue.
"""
filter_logger.info(NOTIFICATIONS_FILTER_JOB_STARTED)
apply_filter()
filter_logger.info(NOTIFICATIONS_FILTER_JOB_ENDED)