-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase_control.py
34 lines (29 loc) · 932 Bytes
/
base_control.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
34
# encoding: utf-8
import os
import datetime
import time
import download_config_apply
import miner
import monitor
import send_email
import sys
from multiprocessing import Process
CONFIG_PATH = 'C:/github/windows_control_miner-main/config.txt'
DOWNLOAD_GAP_TIME = 180
def monitor_process():
os.system("python C:/github/windows_control_miner-main/monitor.py")
if __name__ == '__main__':
send_email.send_email("开机", "开机", 0, 3)
time.sleep(15)
print ("download starting")
download_config_apply.download(1)
CONFIG_DICT = download_config_apply.get_config_data(CONFIG_PATH)
miner.start_mining(0, CONFIG_DICT)
print ("monitor starting")
p = Process(target=monitor_process)
p.start()
send_email.send_email("开始工作", "开始工作", 0, 3)
while True:
time.sleep(DOWNLOAD_GAP_TIME)
import download_config_apply
download_config_apply.download(1)