Set expiry time for key in garnet client #445
-
Is there any way I can set expiration of key while setting the value using garnet.client? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
No its not possible at the time, but if you use StackExchange.Redis as the Service for the Garnet Client (Server), you can use its method wirh StringSetAsync(key, value, TimeSpan.FromMinutes()) to set there an expiration time. |
Beta Was this translation helpful? Give feedback.
-
await db.ExecuteForStringResultAsync("EXPIRE", [key, "30", "NX"]); |
Beta Was this translation helpful? Give feedback.
await db.ExecuteForStringResultAsync("EXPIRE", [key, "30", "NX"]);