Update StoryIndexService, improve redis compatability

pull/6143/head
Daniel Supernault 3 months ago
parent dbba523031
commit 89e34f8f44
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

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

Loading…
Cancel
Save