Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/RocksDb.Extensions/RocksDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public RocksDbContext(IOptions<RocksDbOptions> options)
dbOptions.SetUseDirectIoForFlushAndCompaction(options.Value.UseDirectIoForFlushAndCompaction);

var fOptions = new FlushOptions();
fOptions.SetWaitForFlush(true);
fOptions.SetWaitForFlush(options.Value.WaitForFlush);

var writeOptions = new WriteOptions();
writeOptions.DisableWal(1);
Expand Down
12 changes: 12 additions & 0 deletions src/RocksDb.Extensions/RocksDbOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,16 @@ public class RocksDbOptions
/// The default value is <c>false</c>.
/// </remarks>
public bool UseDirectIoForFlushAndCompaction { get; set; } = false;

/// <summary>
/// Indicates whether the flush operation should be completed before continuing.
/// </summary>
/// <remarks>
/// When set to <c>true</c>, the database will wait for the flush operation to finish before continuing.
/// This helps ensure data durability and consistency, but may slightly impact performance.
/// <para>
/// The default value is <c>true</c>.
/// </para>
/// </remarks>
public bool WaitForFlush { get; set; } = true;
}