diff --git a/source/TempDb/PeanutButter.TempRedis/TempRedis.cs b/source/TempDb/PeanutButter.TempRedis/TempRedis.cs
index a62e233734..a976e5d7f5 100644
--- a/source/TempDb/PeanutButter.TempRedis/TempRedis.cs
+++ b/source/TempDb/PeanutButter.TempRedis/TempRedis.cs
@@ -64,7 +64,7 @@ public interface ITempRedis : IDisposable
///
///
ConnectionMultiplexer Connect();
-
+
///
/// Connect to the redis instance with your own options
///
@@ -96,6 +96,8 @@ public interface ITempRedis : IDisposable
///
public class TempRedisOptions
{
+ public const string ENV_VAR_DISABLE_DISK = "TEMPREDIS_DISABLE_DISK";
+
///
/// Auto-start the service on construction? (default true)
///
@@ -120,7 +122,12 @@ public class TempRedisOptions
/// Enables save-to-disk, which means redis-server should
/// (mostly) survive a crash.
///
- public bool EnableSaveToDisk { get; set; } = true;
+ public bool EnableSaveToDisk { get; set; } =
+ (
+ Environment.GetEnvironmentVariable(ENV_VAR_DISABLE_DISK)
+ ?? "1"
+ )
+ .AsBoolean();
///
/// When enabled (default), only bind to 127.0.0.1