Compare commits

..

No commits in common. "90d62845ca9702a2bdb0d86e2cc834608262f231" and "aa884c7e4493ad3c65cb62fb9b33bf79f73426e1" have entirely different histories.

3 changed files with 7 additions and 10 deletions

View File

@ -40,10 +40,10 @@ async def baidu_sms_kafka_consumer(ns={}):
total_count = 0
for i in range(2):
# if i == 0:
# # 写入文件记录轮询开始时间 时间格式: YYYY-MM-DD HH:MM:SS
# with open('baidu_kafka_msg.txt', 'a', encoding='utf-8') as f:
# f.write(f"轮询开始时间:{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n")
if i == 0:
# 写入文件记录轮询开始时间 时间格式: YYYY-MM-DD HH:MM:SS
with open('baidu_kafka_msg.txt', 'a', encoding='utf-8') as f:
f.write(f"轮询开始时间:{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n")
msg = consumer.poll(0.2) # 单次轮询获取消息
@ -171,8 +171,8 @@ async def baidu_sms_kafka_consumer(ns={}):
'msg': f"处理异常: {str(e)}"
}
# 记录total_count
# with open('baidu_kafka_msg.txt', 'a', encoding='utf-8') as f:
# f.write(f"本次轮询共处理消息数:{total_count}\n")
with open('baidu_kafka_msg.txt', 'a', encoding='utf-8') as f:
f.write(f"本次轮询共处理消息数:{total_count}\n")
consumer.close() # 确保消费者关闭
return {

View File

@ -34,4 +34,4 @@
*/1 * * * * curl https://www.opencomputing.cn/jdcloud/get_partner_order_list.dspy?page=1 > /d/zhc/crontab_prod.log 2>&1
* * * * * curl https://www.opencomputing.cn/baiduc/baidu_new_update_resouce.dspy > /d/zhc/crontab_prod.log 2>&1
#* * * * * curl https://www.opencomputing.cn/baiduc/baidu_sms_kafka_consumer.dspy > /d/zhc/crontab_dev.log 2>&1
*/5 * * * * /usr/bin/python3 /d/zhc/kboss_prod/kgadget/src/more_task_scheduler.py
*/5 * * * * /usr/bin/python3 /d/zhc/kboss_prod/kgadget/src/more_task_scheduler.py >> /tmp/multi_task_scheduler_cron.log 2>&1

View File

@ -25,9 +25,6 @@ logging.basicConfig(
)
logger = logging.getLogger(__name__)
# 屏蔽APScheduler框架日志避免记录框架执行信息
logging.getLogger('apscheduler').setLevel(logging.WARNING)
class ProcessChecker:
"""进程检测类"""