Exemple #1
0
def main():
    load_argvs()
    CommonLog.print_welcome()
    # 初始化配置
    App.run()
    CommonLog.print_configs()
    # 加载站点信息
    App.did_start()
    #print('App.did_start() done.')
    # 检查运行环境的相关目录以及验证码校验的api用户名密码设置是否正确
    App.run_check()
    #print('App.run_check() done')
    # 初始化查询任务,获取余票查询url
    Query.check_before_run()
    #print('Query.check_before_run() done')

    ####### 运行任务
    Web.run()
    Cdn.run()
    #12306账号登录
    User.run()
    Query.run()
    if not Const.IS_TEST:
        while True:
            sleep(10000)
    else:
        if Config().is_cluster_enabled(): stay_second(5)  # 等待接受完通知
    CommonLog.print_test_complete()
Exemple #2
0
def main():
    if '--test' in sys.argv or '-t' in sys.argv: test()
    CommonLog.print_welcome().print_configs()

    App.run_check()
    User.run()
    Query.run()
    if not Const.IS_TEST:
        while True:
            sleep(10000)

    CommonLog.print_test_complete()
Exemple #3
0
def main():
    load_argvs()
    CommonLog.print_welcome()
    App.run()
    CommonLog.print_configs()
    App.did_start()

    App.run_check()
    User.run()
    Query.run()
    if not Const.IS_TEST:
        while True:
            sleep(10000)
    else:
        if Config().is_cluster_enabled(): stay_second(5) # 等待接受完通知
    CommonLog.print_test_complete()