From aeaaa3cf755630902e7fdc7b3b34bd0e2375628d Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Mon, 4 Nov 2024 16:06:34 -0600 Subject: [PATCH] Optimize background services. --- .../BotSharp.Core/Infrastructures/DistributedLocker.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Infrastructures/DistributedLocker.cs b/src/Infrastructure/BotSharp.Core/Infrastructures/DistributedLocker.cs index c2aac231..a5373cd1 100644 --- a/src/Infrastructure/BotSharp.Core/Infrastructures/DistributedLocker.cs +++ b/src/Infrastructure/BotSharp.Core/Infrastructures/DistributedLocker.cs @@ -31,7 +31,7 @@ public class DistributedLocker } } - public async Task Lock(string resource, Func action, int timeoutInSeconds = 30) + public async Task Lock(string resource, Action action, int timeoutInSeconds = 30) { await ConnectToRedis(); @@ -45,7 +45,7 @@ public class DistributedLocker Serilog.Log.Logger.Error($"Acquire lock for {resource} failed due to after {timeout}s timeout."); } - return action(); + action(); } }