mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-28 15:27:24 +08:00
@@ -47,7 +47,7 @@ class CalculateUserSeedBonus implements ShouldQueue
|
|||||||
|
|
||||||
public $tries = 1;
|
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
|
$this->requestId, $this->beginUid, $this->endUid, $this->idStr, $this->idRedisKey
|
||||||
);
|
);
|
||||||
do_log("$logPrefix, job start ...");
|
do_log("$logPrefix, job start ...");
|
||||||
|
|
||||||
$haremAdditionFactor = Setting::get('bonus.harem_addition');
|
$haremAdditionFactor = Setting::get('bonus.harem_addition');
|
||||||
$officialAdditionFactor = Setting::get('bonus.official_addition');
|
$officialAdditionFactor = Setting::get('bonus.official_addition');
|
||||||
$donortimes_bonus = Setting::get('bonus.donortimes');
|
$donortimes_bonus = Setting::get('bonus.donortimes');
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class CleanupRepository extends BaseRepository
|
|||||||
|
|
||||||
private static int $oneTaskSeconds = 0;
|
private static int $oneTaskSeconds = 0;
|
||||||
|
|
||||||
private static int $scanSize = 1000;
|
private static int $scanSize = 500;
|
||||||
|
|
||||||
public static function recordBatch(\Redis $redis, $uid, $torrentId)
|
public static function recordBatch(\Redis $redis, $uid, $torrentId)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -191,7 +191,7 @@ return [
|
|||||||
'maxJobs' => 0,
|
'maxJobs' => 0,
|
||||||
'memory' => 128,
|
'memory' => 128,
|
||||||
'tries' => 1,
|
'tries' => 1,
|
||||||
'timeout' => 600,
|
'timeout' => 120,
|
||||||
'nice' => 0,
|
'nice' => 0,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ return [
|
|||||||
'driver' => 'redis',
|
'driver' => 'redis',
|
||||||
'connection' => 'default',
|
'connection' => 'default',
|
||||||
'queue' => env('REDIS_QUEUE', 'nexus_queue'),
|
'queue' => env('REDIS_QUEUE', 'nexus_queue'),
|
||||||
'retry_after' => 90,
|
'retry_after' => 150,
|
||||||
'block_for' => null,
|
'block_for' => null,
|
||||||
'after_commit' => true,
|
'after_commit' => true,
|
||||||
],
|
],
|
||||||
|
|||||||
+15
-3
@@ -350,9 +350,17 @@ HTML;
|
|||||||
|
|
||||||
public function isIyuu(array $bodyArr): bool
|
public function isIyuu(array $bodyArr): bool
|
||||||
{
|
{
|
||||||
return false;
|
$version = (string)($bodyArr['version'] ?? '');
|
||||||
//Not support, due to change frequently
|
switch ($version) {
|
||||||
// return isset($bodyArr['ret']) && $bodyArr['ret'] == 200;
|
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
|
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');
|
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);
|
$siteIdAndRating = $this->listRatings($ptGenInfo, $torrent->url, $extra->descr);
|
||||||
foreach ($siteIdAndRating as $key => $value) {
|
foreach ($siteIdAndRating as $key => $value) {
|
||||||
if (!isset($ptGenInfo[$key]['data']) || !is_array($ptGenInfo[$key]['data'])) {
|
if (!isset($ptGenInfo[$key]['data']) || !is_array($ptGenInfo[$key]['data'])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user