| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 | # -*- coding: utf-8 -*-from panda_util import PandaUtilimport timefrom report_push import ReportPushclass Config(object):    """        任务id对应的key        day_push:1        week_push_one:2        week_push_two: 3        day_work_two: 4    """    JOBS = [        {            'id': 'day_push',            'func': 'apscheduler_elab:Funcs.day_push',            'args': '',            'trigger': 'cron',            'day_of_week': '*',            'hour': 8,            'minute': 45        },        {            'id': 'week_push_one',            'func': 'apscheduler_elab:Funcs.week_push_one',            'args': '',            'trigger': 'cron',            'day_of_week': 'mon',            'hour': 9,            'minute': 50        },        {            'id': 'week_push_two',            'func': 'apscheduler_elab:Funcs.week_push_two',            'args': '',            'trigger': 'cron',            'day_of_week': 'mon',            'hour': 10,            'minute': 50        },        {            'id': 'day_work_two',            'func': 'apscheduler_elab:Funcs.day_work_two',            'args': '',            'trigger': 'cron',            'day_of_week': '*',            'hour': 8,            'minute': 00        },        {            'id': 'day_work_three',            'func': 'apscheduler_elab:Funcs.day_work_three',            'args': '',            'trigger': 'cron',            'day_of_week': '*',            'hour': 21,            'minute': 20        }    ]    # 线程池配置    SCHEDULER_EXECUTORS = {        'default': {'type': 'threadpool', 'max_workers': 20}    }    SCHEDULER_JOB_DEFAULTS = {        'coalesce': False,        'max_instances': 3    }    # 调度器开关    SCHEDULER_API_ENABLED = True    passclass Funcs(object):    @staticmethod    def day_push():        rp = ReportPush('bi_report')        rp.report_push(1)    @staticmethod    def week_push_one():        rp = ReportPush('bi_report')        rp.report_push(2)    @staticmethod    def week_push_two():        rp = ReportPush('bi_report')        rp.report_push(3)    @staticmethod    def day_work_two():        rp = ReportPush('bi_report')        rp.report_push(4)    @staticmethod    def day_work_three():        rp = ReportPush('bi_report')        rp.report_push_test(4)    @staticmethod    def minute_push_elab():        # pdu = PandaUtil('linshi')        # sql = 'select house_id, COUNT(house_id) as number from t_house_image group by house_id limit 5'        # file_name = 'pandas_chart_columns2{}.xlsx'.format(time.time())        # df_data = pdu.query_data(sql)        # print(df_data.size)        # pdu.panda_chart([df_data], 1, 'title x', 'title y', file_name)        print('wwwww')if __name__ == '__main__':    pass
 |