Skip to content

Commit 57dffd3

Browse files
authored
Merge pull request #38 from ipfs-shipyard/mfs/add-flush-property
Add a bool Flush property to MfsWriteOptions
2 parents f829aff + 3571c49 commit 57dffd3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/CoreApi/MfsWriteOptions.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,16 @@ public class MfsWriteOptions
7777
/// </value>
7878
/// <seealso cref="MultiHash.DefaultAlgorithmName"/>
7979
public string? Hash { get; set; } = null;
80+
81+
/// <summary>
82+
/// Flush the data to disk after writing.
83+
/// </summary>
84+
/// <value>
85+
/// The default is <b>null</b> and the server will use its default of true.
86+
/// </value>
87+
/// <remarks>
88+
/// Use caution when setting this flag to false. It will improve performance for large numbers of file operations, but it does so at the cost of consistency guarantees. If the daemon is unexpectedly killed before running a proper flush, then data may be lost. This also applies to running the gc concurrently with flush false.
89+
/// </remarks>
90+
public bool? Flush { get; set; } = null;
8091
}
8192
}

src/IpfsCore.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<LangVersion>12.0</LangVersion>
99

1010
<!-- https://semver.org/spec/v2.0.0.html -->
11-
<Version>0.6.0</Version>
11+
<Version>0.6.1</Version>
1212
<AssemblyVersion>$(Version)</AssemblyVersion>
1313

1414
<!-- Nuget specs -->
@@ -30,6 +30,10 @@
3030
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
3131
<GenerateDocumentationFile>true</GenerateDocumentationFile>
3232
<PackageReleaseNotes>
33+
--- 0.6.1 ---
34+
[New]
35+
Added missing MfsWriteOptions.Flush property.
36+
3337
--- 0.6.0 ---
3438
[Breaking]
3539
Added missing IMfsApi.ReadFileStreamAsync method.

0 commit comments

Comments
 (0)