Merge pull request #403 from specialpointcentral/php8

Some fixups
This commit is contained in:
xiaomlove
2025-12-20 13:16:33 +07:00
committed by GitHub
5 changed files with 20 additions and 7 deletions

View File

@@ -47,7 +47,7 @@ class CalculateUserSeedBonus implements ShouldQueue
public $tries = 1;
public $timeout = 3600;
public $timeout = 120;
/**
* 获取任务时,应该通过的中间件。
@@ -72,6 +72,7 @@ class CalculateUserSeedBonus implements ShouldQueue
$this->requestId, $this->beginUid, $this->endUid, $this->idStr, $this->idRedisKey
);
do_log("$logPrefix, job start ...");
$haremAdditionFactor = Setting::get('bonus.harem_addition');
$officialAdditionFactor = Setting::get('bonus.official_addition');
$donortimes_bonus = Setting::get('bonus.donortimes');

View File

@@ -37,7 +37,7 @@ class CleanupRepository extends BaseRepository
private static int $oneTaskSeconds = 0;
private static int $scanSize = 1000;
private static int $scanSize = 500;
public static function recordBatch(\Redis $redis, $uid, $torrentId)
{

View File

@@ -191,7 +191,7 @@ return [
'maxJobs' => 0,
'memory' => 128,
'tries' => 1,
'timeout' => 600,
'timeout' => 120,
'nice' => 0,
],
],

View File

@@ -66,7 +66,7 @@ return [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'nexus_queue'),
'retry_after' => 90,
'retry_after' => 150,
'block_for' => null,
'after_commit' => true,
],

View File

@@ -350,9 +350,17 @@ HTML;
public function isIyuu(array $bodyArr): bool
{
return false;
//Not support, due to change frequently
// return isset($bodyArr['ret']) && $bodyArr['ret'] == 200;
$version = (string)($bodyArr['version'] ?? '');
switch ($version) {
case '2.0.0':
return isset($bodyArr['ret'])
&& intval($bodyArr['ret']) === 200
&& isset($bodyArr['data']['format'])
&& is_string($bodyArr['data']['format'])
&& $bodyArr['data']['format'] !== '';
default:
return false;
}
}
public function listRatings(array $ptGenData, string $imdbLink, string $desc = ''): array
@@ -574,6 +582,10 @@ HTML;
do_log("$log, site: $site can not be updated: " . $exception->getMessage(), 'error');
}
}
if (empty($ptGenInfo)) {
do_log("$log, no pt gen info updated");
return false;
}
$siteIdAndRating = $this->listRatings($ptGenInfo, $torrent->url, $extra->descr);
foreach ($siteIdAndRating as $key => $value) {
if (!isset($ptGenInfo[$key]['data']) || !is_array($ptGenInfo[$key]['data'])) {