123456789101112131415161718192021222324252627282930 |
- # -*- coding: utf-8 -*-
- # @Author: wangkun
- # @Time: 2022/8/31
- import datetime
- import os
- import sys
- import time
- sys.path.append(os.getcwd())
- from main.common import Common
- from main.shipinhao_recommend import Recommend
- class Main:
- @classmethod
- def main(cls, env):
- while True:
- if 20 >= datetime.datetime.now().hour >= 10:
- if len(Recommend.download_cnt) >= 100:
- Recommend.download_cnt = []
- Common.del_logs('recommend')
- time.sleep(3600 * (24-datetime.datetime.now().hour))
- else:
- Recommend.start_wechat('recommend', env)
- time.sleep(3)
- else:
- pass
- if __name__ == '__main__':
- Main.main('prod')
|