fix Cleanup runBatchJob

This commit is contained in:
lgb
2023-07-24 21:44:22 +08:00
parent 308cc93e6a
commit d393d83379
2 changed files with 11 additions and 13 deletions
+1 -3
View File
@@ -88,7 +88,6 @@ class CleanupRepository extends BaseRepository
/* Don't ever return an empty array until we're done iterating */ /* Don't ever return an empty array until we're done iterating */
$redis->setOption(\Redis::OPT_SCAN, \Redis::SCAN_RETRY); $redis->setOption(\Redis::OPT_SCAN, \Redis::SCAN_RETRY);
while($arr_keys = $redis->hScan($batch, $it, "*", self::$scanSize)) { while($arr_keys = $redis->hScan($batch, $it, "*", self::$scanSize)) {
foreach($arr_keys as $k => $v) {
$delay = self::getDelay($batchKeyInfo['task_index'], $length, $page); $delay = self::getDelay($batchKeyInfo['task_index'], $length, $page);
$idStr = implode(",", array_keys($arr_keys)); $idStr = implode(",", array_keys($arr_keys));
$command = sprintf( $command = sprintf(
@@ -97,9 +96,8 @@ class CleanupRepository extends BaseRepository
); );
$output = executeCommand($command, 'string', true); $output = executeCommand($command, 'string', true);
do_log(sprintf('command: %s, output: %s', $command, $output)); do_log(sprintf('command: %s, output: %s', $command, $output));
$page++;
$count += count($arr_keys); $count += count($arr_keys);
} $page++;
} }
//remove this batch //remove this batch
+1 -1
View File
@@ -1,6 +1,6 @@
<?php <?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.5'); defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.5');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-07-22'); defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-07-24');
defined('IN_TRACKER') || define('IN_TRACKER', false); defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP"); defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org"); defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");