|
|
|
@ -238,9 +238,7 @@ class StoryIndexService
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$lockKey = $this->rebuildLockKey();
|
|
|
|
$lockKey = $this->rebuildLockKey();
|
|
|
|
|
|
|
|
|
|
|
|
$lockAcquired = config('database.redis.client') === 'predis'
|
|
|
|
$lockAcquired = Redis::set($lockKey, '1', 'EX', self::REBUILD_LOCK_TTL, 'NX');
|
|
|
|
? Redis::set($lockKey, '1', 'EX', self::REBUILD_LOCK_TTL, 'NX')
|
|
|
|
|
|
|
|
: Redis::set($lockKey, '1', ['ex' => self::REBUILD_LOCK_TTL, 'nx' => true]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (! $lockAcquired) {
|
|
|
|
if (! $lockAcquired) {
|
|
|
|
return ['status' => 'already_rebuilding', 'message' => 'Index rebuild already in progress'];
|
|
|
|
return ['status' => 'already_rebuilding', 'message' => 'Index rebuild already in progress'];
|
|
|
|
|