Refactoring to clean up asynchronous tasks

This commit is contained in:
xiaomlove
2023-07-22 02:04:41 +08:00
parent 30aae54673
commit 52d84dc450
5 changed files with 117 additions and 118 deletions
+2 -12
View File
@@ -387,12 +387,7 @@ function docleanup($forceAll = 0, $printProgress = false) {
// sql_query("UPDATE torrents SET " . implode(",", $update) . " WHERE id = $id") or sqlerr(__FILE__, __LINE__);
// }
$command = sprintf(
'cleanup --action=seeders_etc --begin_id=%s --end_id=%s --request_id=%s --delay=%s',
0, 0, $requestId, 0
);
$output = executeCommand($command, 'string', true);
do_log(sprintf('command: %s, output: %s', $command, $output));
\App\Repositories\CleanupRepository::runBatchJobUpdateTorrentSeedersEtc($requestId);
$log = "update count of seeders, leechers, comments for torrents";
do_log($log);
@@ -870,12 +865,7 @@ function docleanup($forceAll = 0, $printProgress = false) {
// sql_query("UPDATE users SET seedtime = " . intval($arr2['st']) . ", leechtime = " . intval($arr2['lt']) . " WHERE id = " . $arr['id']) or sqlerr(__FILE__, __LINE__);
// }
$command = sprintf(
'cleanup --action=seeding_leeching_time --begin_id=%s --end_id=%s --request_id=%s --delay=%s',
0, 0, $requestId, 0
);
$output = executeCommand($command, 'string', true);
do_log(sprintf('command: %s, output: %s', $command, $output));
\App\Repositories\CleanupRepository::runBatchJobUpdateUserSeedingLeechingTime($requestId);
$log = "update total seeding and leeching time of users";
do_log($log);
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.5');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-07-19');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-07-22');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");