-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
29 lines (22 loc) · 892 Bytes
/
app.py
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
import logging
from common.database import engine
from common.models import Base
from config import config
from workers import CtftimeMonitor, EventChecker, TelegramMonitor
def main():
if config['DEBUG']:
logging.basicConfig(level=logging.DEBUG,
format='%(levelname)s[%(asctime)s] %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
logging.getLogger("sqlalchemy.engine").setLevel(logging.DEBUG)
logging.getLogger("sqlalchemy.pool").setLevel(logging.DEBUG)
else:
logging.basicConfig(level=logging.INFO,
format='%(levelname)s[%(asctime)s] %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
Base.metadata.create_all(engine)
CtftimeMonitor().start()
TelegramMonitor().start()
EventChecker().start()
if __name__ == '__main__':
main()