-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_check.py
More file actions
40 lines (27 loc) · 1 KB
/
run_check.py
File metadata and controls
40 lines (27 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os
import json
import constants1
from pytz import utc
from apscheduler.schedulers.blocking import BlockingScheduler
from apscheduler.executors.pool import ThreadPoolExecutor
import azure
import gcp
import aws
if __name__ == '__main__':
services = constants1.SERVICES
SCHEDULER_INTERVAL = constants1.SCHEDULER_INTERVAL # in seconds
executors = {
'default': ThreadPoolExecutor()
}
app_scheduler = BlockingScheduler(executors=executors, timezone=utc)
for service in services:
if service == 'aws':
app_scheduler.add_job(aws.run , 'interval', seconds=10,
id='aws check scheduler')
if service == 'gcp':
app_scheduler.add_job(gcp.run , 'interval', seconds=10,
id='gcp check scheduler')
if service == 'azure':
app_scheduler.add_job(azure.run , 'interval', seconds=10,
id='azure check scheduler')
app_scheduler.start()