From cfccd59ce1d49ebd5d9e87308719df823cd99423 Mon Sep 17 00:00:00 2001 From: hardstylewyl <827778732@qq.com> Date: Tue, 25 Mar 2025 17:11:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dhangfire=E7=9A=84redisKey?= =?UTF-8?q?=E5=89=8D=E7=BC=80=E5=A2=9E=E5=8A=A0:=E5=8F=B7=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E8=AE=BE=E7=BD=AE=E7=BB=88=E6=AD=A2=E6=80=81=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=8F=AA=E4=BF=9D=E7=95=991=E5=B0=8F=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SJZY.Track.Application/SjzyTrackApplicationModule.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs index 002317a4..53284c7a 100644 --- a/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs +++ b/src/SJZY.Track.Application/SjzyTrackApplicationModule.cs @@ -221,12 +221,13 @@ public class SjzyTrackApplicationModule : AbpModule context.Services.Configure(configuration.GetSection("WarningTask")); context.Services.AddHangfire(o => { - var options = new RedisStorageOptions() + var options = new RedisStorageOptions { - Prefix = GlobalConst.TrackHangfireKeyPrefix, + Prefix = $"{GlobalConst.TrackHangfireKeyPrefix}:", Db = int.Parse(configuration["Redis:Database"]!), }; - o.UseRedisStorage(connectionString,options); + o.UseRedisStorage(connectionString, options) + .WithJobExpirationTimeout(TimeSpan.FromHours(1)); // 终止态任务只保留1小时 }); context.Services.AddHangfireServer(o => {