代码拉取完成,页面将自动刷新
同步操作将从 louisyoungx/jd-shopper 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
from Core.core import main
from Logger.logger import logger
from Scheduler.scheduler import Timer
from Config.settings import config
from Server.server import server
from threading import Thread
from GUI.gui import gui
from concurrent.futures import ProcessPoolExecutor
PROCESS_MODEL = config.settings("Server", "PROCESS_MODEL")
SCHEDULER = config.settings("Scheduler", "START_USING")
SERVER = config.settings("Server", "START_USING")
GUI = config.settings("GUI", "START_USING")
def running():
if not SCHEDULER:
thread_main = Thread(target=main)
thread_main.start()
else: # 调度器开启后main函数将被scheduler调度器代理,开启定时执行main
startTime = config.settings("Scheduler", "START_TIME")
skipWeekend = config.settings("Scheduler", "SKIP_WEEKEND")
scheduler = Timer(task=main, startTime=startTime, skipWeekend=skipWeekend)
thread_scheduler = Thread(target=scheduler.schedule)
thread_scheduler.start()
if SERVER:
if PROCESS_MODEL:
work_count = config.settings("Server", "PROCESS_COUNT")
server_process(work_count)
else:
thread_server = Thread(target=server)
thread_server.start()
if GUI:
gui()
def server_process(work_count=4):
with ProcessPoolExecutor(work_count) as pool:
for i in range(work_count):
pool.submit(server())
if __name__ == "__main__":
DEBUG = config.settings("Debug", "DEBUG")
if DEBUG:
logger.info("\n===== DEBUG MODE =====")
main()
else:
running()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。