From b37450c2f530a9f880bdc3309c12a5c49a60fe5f Mon Sep 17 00:00:00 2001 From: Deeka Wong <8337659+huangdijia@users.noreply.github.com> Date: Wed, 11 Sep 2024 22:17:32 +0800 Subject: [PATCH] chore: Update RedisServerMutex.php to include owner information in debug log --- publish/trigger.php | 1 + src/Mutex/RedisServerMutex.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/publish/trigger.php b/publish/trigger.php index 4de32d0..0df2ab8 100644 --- a/publish/trigger.php +++ b/publish/trigger.php @@ -26,6 +26,7 @@ 'server_mutex' => [ 'enable' => true, + 'prefix' => env('APP_ENV', 'dev') . '_', 'expires' => 30, 'keepalive_interval' => 10, 'retry_interval' => 10, diff --git a/src/Mutex/RedisServerMutex.php b/src/Mutex/RedisServerMutex.php index cfd2a8b..adaf19f 100644 --- a/src/Mutex/RedisServerMutex.php +++ b/src/Mutex/RedisServerMutex.php @@ -42,7 +42,7 @@ public function __construct( ) { $this->expires = (int) ($options['expires'] ?? 60); $this->keepaliveInterval = (int) ($options['keepalive_interval'] ?? 10); - $this->name = $name ?? sprintf('trigger:server:%s', $this->connection); + $this->name = ($options['prefix'] ?? '') . ($name ?? sprintf('trigger:server:%s', $this->connection)); $this->owner = $owner ?? Util::getInternalIp(); if (isset($options['connection'])) { $this->connection = $options['connection'];