Remove deprecated files and scripts related to cron jobs and WeChat server functionality. Update README to include new server startup methods using uWSGI and Gunicorn. Ensure callback server configuration is loaded properly in production environments. Clean up unnecessary test scripts and example files to streamline the project structure.

This commit is contained in:
2026-01-08 21:59:39 +08:00
parent 85cd7e9d3e
commit 4000438f49
45 changed files with 312 additions and 9057 deletions
+119
View File
@@ -0,0 +1,119 @@
Thu Jan 8 21:50:36 2026 - *** Starting uWSGI 2.0.31 (64bit) on [Thu Jan 8 21:50:36 2026] ***
Thu Jan 8 21:50:36 2026 - compiled with version: 14.2.0 on 06 January 2026 09:35:56
Thu Jan 8 21:50:36 2026 - os: Linux-6.14.0-37-generic #37-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 22:10:32 UTC 2025
Thu Jan 8 21:50:36 2026 - nodename: ubserver
Thu Jan 8 21:50:36 2026 - machine: x86_64
Thu Jan 8 21:50:36 2026 - clock source: unix
Thu Jan 8 21:50:36 2026 - pcre jit disabled
Thu Jan 8 21:50:36 2026 - detected number of CPU cores: 12
Thu Jan 8 21:50:36 2026 - current working directory: /home/v6ole/pyproject/GX-gp-notify
Thu Jan 8 21:50:36 2026 - writing pidfile to ./uwsgi-wechat.pid
Thu Jan 8 21:50:36 2026 - detected binary path: /home/v6ole/pyproject/GX-gp-notify/venv/bin/uwsgi
Thu Jan 8 21:50:36 2026 - uWSGI running as root, you can use --uid/--gid/--chroot options
Thu Jan 8 21:50:36 2026 - *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Thu Jan 8 21:50:36 2026 - chdir() to /home/v6ole/pyproject/GX-gp-notify
Thu Jan 8 21:50:36 2026 - your processes number limit is 61306
Thu Jan 8 21:50:36 2026 - your memory page size is 4096 bytes
Thu Jan 8 21:50:36 2026 - *** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***
Thu Jan 8 21:50:36 2026 - detected max file descriptor number: 1073741816
Thu Jan 8 21:50:36 2026 - lock engine: pthread robust mutexes
Thu Jan 8 21:50:36 2026 - thunder lock: disabled (you can enable it with --thunder-lock)
Thu Jan 8 21:50:36 2026 - uWSGI http bound on 0.0.0.0:18001 # 指定 uWSGI 监听的 HTTP 地址和端口 fd 4
Thu Jan 8 21:50:36 2026 - uwsgi socket 0 bound to TCP address 127.0.0.1:40181 (port auto-assigned) fd 3
Thu Jan 8 21:50:36 2026 - uWSGI running as root, you can use --uid/--gid/--chroot options
Thu Jan 8 21:50:36 2026 - *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Thu Jan 8 21:50:36 2026 - Python version: 3.13.11 | packaged by Anaconda, Inc. | (main, Dec 10 2025, 21:39:52) [GCC 14.3.0]
Thu Jan 8 21:50:36 2026 - PEP 405 virtualenv detected: /home/v6ole/pyproject/GX-gp-notify/venv
Thu Jan 8 21:50:36 2026 - Set PythonHome to /home/v6ole/pyproject/GX-gp-notify/venv
Thu Jan 8 21:50:36 2026 - Python main interpreter initialized at 0x7eb9b7352d10
Thu Jan 8 21:50:36 2026 - uWSGI running as root, you can use --uid/--gid/--chroot options
Thu Jan 8 21:50:36 2026 - *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Thu Jan 8 21:50:36 2026 - python threads support enabled
Thu Jan 8 21:50:36 2026 - your server socket listen backlog is limited to 100 connections
Thu Jan 8 21:50:36 2026 - your mercy for graceful operations on workers is 60 seconds
Thu Jan 8 21:50:36 2026 - mapped 250032 bytes (244 KB) for 4 cores
Thu Jan 8 21:50:36 2026 - *** Operational MODE: preforking+threaded ***
2026-01-08 21:50:36 - gx_gp_monitor.wechat.message_handler - INFO - 企业微信消息处理器初始化完成
2026-01-08 21:50:36 - gx_gp_monitor.wechat.callback_server - INFO - 企业微信回调服务器初始化完成
Thu Jan 8 21:50:36 2026 - WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x7eb9b7352d10 pid: 1560152 (default app)
Thu Jan 8 21:50:36 2026 - uWSGI running as root, you can use --uid/--gid/--chroot options
Thu Jan 8 21:50:36 2026 - *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Thu Jan 8 21:50:36 2026 - *** uWSGI is running in multiple interpreter mode ***
Thu Jan 8 21:50:36 2026 - spawned uWSGI master process (pid: 1560152)
Thu Jan 8 21:50:36 2026 - spawned uWSGI worker 1 (pid: 1560188, cores: 2)
Thu Jan 8 21:50:36 2026 - spawned uWSGI worker 2 (pid: 1560190, cores: 2)
Thu Jan 8 21:50:36 2026 - Python auto-reloader enabled
Thu Jan 8 21:50:36 2026 - spawned uWSGI http 1 (pid: 1560194)
2026-01-08 21:51:00 - gx_gp_monitor.wechat.callback_server - ERROR - ✅ XML解析成功,提取的encrypt长度: 472
2026-01-08 21:51:00 - gx_gp_monitor.wechat.callback_server - ERROR - 提取的encrypt前50字符: jiJ2j73W7wKovmd8M9YmBGuai+FUfQCGkPH1KYPM4mCA1q/3jr...
2026-01-08 21:51:00 - gx_gp_monitor.wechat.callback_server - ERROR - 计算的签名: a62b23e0fce089e9ee78072a8467642588448e65
2026-01-08 21:51:00 - gx_gp_monitor.wechat.callback_server - ERROR - 接收的签名: a62b23e0fce089e9ee78072a8467642588448e65
2026-01-08 21:51:00 - gx_gp_monitor.wechat.callback_server - ERROR - 签名匹配: True
2026-01-08 21:51:00 - gx_gp_monitor.wechat.callback_server - ERROR - 尝试使用默认token计算签名...
2026-01-08 21:51:00 - gx_gp_monitor.wechat.callback_server - INFO - 收到企业微信消息: 类型=text
2026-01-08 21:51:00 - gx_gp_monitor.wechat.callback_server - INFO - 处理文本消息: content=爬取 大化..., user=WeiJueSen
2026-01-08 21:51:00 - gx_gp_monitor.wechat.message_handler - INFO - 处理文本消息: 爬取 大化, user: WeiJueSen
2026-01-08 21:51:00 - gx_gp_monitor.wechat.message_handler - INFO - 用户 WeiJueSen 手动爬取关键词: ['大化']
2026-01-08 21:51:00 - gx_gp_monitor.main - INFO - === 广西政府采购网公告监控系统启动 ===
2026-01-08 21:51:00 - gx_gp_monitor.main - INFO - 版本: 1.0.0
2026-01-08 21:51:00 - gx_gp_monitor.main - INFO - 配置文件: 默认配置
2026-01-08 21:51:00 - gx_gp_monitor.core.reliability - INFO - 健康检查通过
2026-01-08 21:51:00 - gx_gp_monitor.core.database - INFO - 数据库连接池初始化成功
2026-01-08 21:51:00 - gx_gp_monitor.core.database - INFO - 开始初始化数据库表结构
2026-01-08 21:51:00 - gx_gp_monitor.core.database - INFO - 数据库表结构初始化完成
2026-01-08 21:51:00 - gx_gp_monitor.storage.postgresql - INFO - 存储初始化完成
2026-01-08 21:51:00 - gx_gp_monitor.main - INFO - 应用初始化完成
2026-01-08 21:51:00 - gx_gp_monitor.main - INFO - 开始执行爬取任务 (手动爬取: True)
2026-01-08 21:51:00 - gx_gp_monitor.crawler.spider - INFO - 开始爬取 13 个公告来源
2026-01-08 21:51:00 - gx_gp_monitor - INFO - 开始爬取 采购公告
2026-01-08 21:51:00 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:00 - gx_gp_monitor - INFO - 采购公告 爬取完成,共获取 100 条公告,耗时 0.49秒
2026-01-08 21:51:00 - gx_gp_monitor - INFO - 开始爬取 结果公告
2026-01-08 21:51:01 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:01 - gx_gp_monitor - INFO - 结果公告 爬取完成,共获取 100 条公告,耗时 0.23秒
2026-01-08 21:51:01 - gx_gp_monitor - INFO - 开始爬取 合同公告
2026-01-08 21:51:01 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:01 - gx_gp_monitor - INFO - 合同公告 爬取完成,共获取 100 条公告,耗时 0.26秒
2026-01-08 21:51:01 - gx_gp_monitor - INFO - 开始爬取 更正公告
2026-01-08 21:51:01 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:01 - gx_gp_monitor - INFO - 更正公告 爬取完成,共获取 100 条公告,耗时 0.23秒
2026-01-08 21:51:01 - gx_gp_monitor - INFO - 开始爬取 招标文件预公示
2026-01-08 21:51:01 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:01 - gx_gp_monitor - INFO - 招标文件预公示 爬取完成,共获取 100 条公告,耗时 0.26秒
2026-01-08 21:51:01 - gx_gp_monitor - INFO - 开始爬取 单一来源公示
2026-01-08 21:51:02 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:02 - gx_gp_monitor - INFO - 单一来源公示 爬取完成,共获取 100 条公告,耗时 0.20秒
2026-01-08 21:51:02 - gx_gp_monitor - INFO - 开始爬取 电子卖场公示
2026-01-08 21:51:02 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:02 - gx_gp_monitor - INFO - 电子卖场公示 爬取完成,共获取 100 条公告,耗时 0.39秒
2026-01-08 21:51:02 - gx_gp_monitor - INFO - 开始爬取 履约验收公示
2026-01-08 21:51:02 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:02 - gx_gp_monitor - INFO - 履约验收公示 爬取完成,共获取 100 条公告,耗时 0.23秒
2026-01-08 21:51:02 - gx_gp_monitor - INFO - 开始爬取 工程类公告
2026-01-08 21:51:02 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:02 - gx_gp_monitor - INFO - 工程类公告 爬取完成,共获取 100 条公告,耗时 0.23秒
2026-01-08 21:51:02 - gx_gp_monitor - INFO - 开始爬取 框架协议征集公告
2026-01-08 21:51:03 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:03 - gx_gp_monitor - INFO - 框架协议征集公告 爬取完成,共获取 100 条公告,耗时 0.25秒
2026-01-08 21:51:03 - gx_gp_monitor - INFO - 开始爬取 框架协议入围结果公告
2026-01-08 21:51:03 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:03 - gx_gp_monitor - INFO - 框架协议入围结果公告 爬取完成,共获取 100 条公告,耗时 0.20秒
2026-01-08 21:51:03 - gx_gp_monitor - INFO - 开始爬取 框架协议成交结果汇总公告
2026-01-08 21:51:03 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:03 - gx_gp_monitor - INFO - 框架协议成交结果汇总公告 爬取完成,共获取 100 条公告,耗时 0.19秒
2026-01-08 21:51:03 - gx_gp_monitor - INFO - 开始爬取 采购意向公开
2026-01-08 21:51:03 - gx_gp_monitor.crawler.parsers - INFO - 成功解析 100/100 条公告记录
2026-01-08 21:51:03 - gx_gp_monitor - INFO - 采购意向公开 爬取完成,共获取 100 条公告,耗时 0.23秒
2026-01-08 21:51:03 - gx_gp_monitor.crawler.spider - INFO - 爬取完成: 共处理 13 个来源,成功 13 个,失败 0 个,获取 1300 条公告
2026-01-08 21:51:03 - gx_gp_monitor.main - INFO - 爬取到 1300 条原始公告
2026-01-08 21:51:03 - gx_gp_monitor.main - INFO - 手动爬取模式:跳过数据库保存
2026-01-08 21:51:03 - gx_gp_monitor.filters.filters - INFO - 日期筛选: 1300 -> 537 条公告
2026-01-08 21:51:03 - gx_gp_monitor.filters.filters - INFO - 关键词筛选: 537 -> 2 条公告
2026-01-08 21:51:03 - gx_gp_monitor.filters.filters - INFO - 来源筛选: 2 -> 2 条公告
2026-01-08 21:51:03 - gx_gp_monitor.main - INFO - 筛选后剩余 2 条公告
2026-01-08 21:51:03 - gx_gp_monitor.main - INFO - 手动爬取模式:跳过筛选后公告的数据库保存
2026-01-08 21:51:03 - gx_gp_monitor.main - INFO - 爬取任务完成: {'success': True, 'total_crawled': 1300, 'filtered': 2, 'saved': 0, 'markdown_generated': False, 'notification_sent': True, 'filter_stats': {'keyword_filtered': 535, 'date_filtered': 763, 'duplicate_filtered': 0, 'source_filtered': 0}, 'filtered_announcements': [Announcement(id=None, title='广西壮族自治区大化公路养护中心2026年3月至4月政府采购意向', publish_date=datetime.datetime(2026, 1, 8, 16, 55, 31), purchase_name='广西壮族自治区大化公路养护中心', content_url='https://zfcg.gxzf.gov.cn/site/detail?parentId=66485&articleId=aMzhKRWZyOvYpGoEA4k/8g==', source_code='61-266648', source_name='采购意向公开', announcement_type=<AnnouncementType.INTENTION: 'intention'>, crawled_at=datetime.datetime(2026, 1, 8, 21, 51, 3, 530262), created_at=None, updated_at=None, content_hash='1895a00610c2dc0dfbcdb724260f4597', keyword_matched=True, date_filtered=True, is_new=True, is_today=True), Announcement(id=None, title='中国共产党大化瑶族自治县委员会组织部2026年2月至3月政府采购意向', publish_date=datetime.datetime(2026, 1, 8, 11, 41, 6), purchase_name='中国共产党大化瑶族自治县委员会组织部', content_url='https://zfcg.gxzf.gov.cn/site/detail?parentId=66485&articleId=Qgm7DlkoLsuw6Asij2HL8w==', source_code='61-266648', source_name='采购意向公开', announcement_type=<AnnouncementType.INTENTION: 'intention'>, crawled_at=datetime.datetime(2026, 1, 8, 21, 51, 3, 530262), created_at=None, updated_at=None, content_hash='4a57bc4330c2885de63b8d96b8f686bb', keyword_matched=True, date_filtered=True, is_new=True, is_today=True)]}
2026-01-08 21:51:03 - gx_gp_monitor.notification.wechat - INFO - 企业微信服务初始化完成
2026-01-08 21:51:04 - gx_gp_monitor.notification.wechat - INFO - 成功获取企业微信访问令牌
2026-01-08 21:51:04 - gx_gp_monitor.notification.wechat - INFO - Markdown消息发送成功
{address space usage: 241336320 bytes/230MB} {rss usage: 53772288 bytes/51MB} [pid: 1560190|app: 0|req: 1/1] 14.116.241.251 () {36 vars in 679 bytes} [Thu Jan 8 21:51:00 2026] POST /api/v1/wechat/callback?msg_signature=a62b23e0fce089e9ee78072a8467642588448e65&timestamp=1767880260&nonce=1767803646 => generated 582 bytes in 4177 msecs (HTTP/1.1 200) 2 headers in 80 bytes (1 switches on core 0)