后台任务“清理”的重要性

经常有网友报告一些数据更新问题,比如魔力/做种积分/BT时间不涨,VIP 过期了等级不恢复,此类问题,请检查后台的“清理”任务是正常。

“清理”是 NP 里非常重要的一个功能,很多数据更新都依靠此任务。系统管理员可以在管理组面板中手动执行,在 URL 后面添加参数:?forceall=1

忽略时间间隔不够强制完全执行。

如果能正常走完,输出会是如下的样子,认准最后的“Full cleanup is done”字样,只有出现这一句才说明是完全执行完成!clean-up in progress…please wait [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] update peer status … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] calculate seeding bonus … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] update torrents’ visibility … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] update count of seeders, leechers, comments for torrents … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] set no-advertisement-by-bonus time out … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] update forum post/topic count … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete offers if not voted on after some time … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete offers if not uploaded after being voted on for some time. … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] expire torrent promotion … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] automatically pick hot … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete unconfirmed accounts … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete old login attempts … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete old invite codes … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete regimage codes … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete inactive user accounts, no transfer. Alt. 1: last access time … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete inactive user accounts, no transfer. Alt. 2: registering time … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete inactive user accounts, not parked … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete parked user accounts, parked … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] remove VIP status if time’s up … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] promote peasant back to user … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] promote users to other classes … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] demote users to other classes … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] demote Users to peasant … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] ban users with leechwarning expired … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] remove warning of users … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] update total seeding and leeching time of users … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete torrents that have been dead for a long time … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] update clients’ popularity … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete old messages sent by system … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete old readpost records … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete old ip log … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete old general log … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete torrents that doesn’t exist any more … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] lock topics where last post was made more than x days ago … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] delete report items older than four week … done! [2022-04-27 13:33:59] [af496268d5c72f4602712176761e5b5a] Full cleanup is done … done! Full cleanup is done Time consumed: 0.617791 sec Done

从输出信息也可以看到,“清理”会执行很多任务,如果“清理”不正常,网站整体运行肯定也是不正常的。因此安装的时候,一定要按照文档操作配置好后台任务,这是必须的,不是可选的!

文档中要求配置的后台任务有两个,除了“清理”外,另外一个跟考核、H&R、备份、删除长期不活跃 api token 等有关,由于不是旧 NP 所有,故独立开来,也是必不可少的。

配置好后,一定要看重定向输出内容也就是 >> 后面那个文件里面的内容,得是像上面浏览器执行时输出的内容一样没有报错信息才算正常。按文档配置好后也可以手动执行一次看能否成功。在根目录下,执行以下命令(后面的参数 1 表示强制):php include/cleanup_cli.php 1

看内容输出是否正常。如果长时间卡住,可能是内存配置得过低,修改 memory_limit 为更大的值。

只有这两个后台任务运行正常,网站整体运行才会正常!

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注