@@ -81,8 +81,12 @@ local second_op
8181 /// Unlinks a JSON object and sets the key again with a fresh new JSON object.
8282 /// </summary>
8383 internal const string UnlinkAndSendJson = @"
84+ local expiry = tonumber(redis.call('PTTL', KEYS[1]))
8485redis.call('UNLINK', KEYS[1])
8586redis.call('JSON.SET', KEYS[1], '.', ARGV[1])
87+ if expiry > 0 then
88+ redis.call('PEXPIRE', KEYS[1], expiry)
89+ end
8690return 0
8791" ;
8892
@@ -100,8 +104,8 @@ local second_op
100104 redis.call('HSET', KEYS[1], unpack(hashArgs))
101105 if expiry > 0 then
102106 redis.call('PEXPIRE', KEYS[1], expiry)
103- end
104- return 1
107+ end
108+ return 1
105109end
106110return 0
107111" ;
@@ -151,7 +155,7 @@ local second_op
151155 /// <summary>
152156 /// The scripts.
153157 /// </summary>
154- internal static readonly Dictionary < string , string > ScriptCollection = new ( )
158+ internal static readonly Dictionary < string , string > ScriptCollection = new ( )
155159 {
156160 { nameof ( JsonDiffResolution ) , JsonDiffResolution } ,
157161 { nameof ( HashDiffResolution ) , HashDiffResolution } ,
@@ -166,6 +170,6 @@ local second_op
166170 /// <summary>
167171 /// Gets or sets collection of SHAs.
168172 /// </summary>
169- internal static ConcurrentDictionary < string , string > ShaCollection { get ; set ; } = new ( ) ;
173+ internal static ConcurrentDictionary < string , string > ShaCollection { get ; set ; } = new ( ) ;
170174 }
171- }
175+ }
0 commit comments