-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathmain.py
33 lines (30 loc) · 774 Bytes
/
main.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
30
31
32
33
# coding=utf-8
from gevent import monkey
monkey.patch_all()
import time
import traceback
import const as ct
from base.clog import getLogger
from base.cthread import CThread
from data_manager import DataManager
from jobs.scheduler import Scheduler
log = getLogger(__name__)
def main():
time.sleep(200)
threadList = []
sc = Scheduler()
dm = DataManager(ct.DB_INFO)
log.info("init succeed")
#threadList.append(CThread(dm.run, 1500))
threadList.append(CThread(dm.update, 1500))
threadList.append(sc.start())
for thread in threadList:
thread.start()
for thread in threadList:
thread.join()
if __name__ == "__main__":
try:
main()
except Exception as e:
log.error(e)
traceback.print_exc()