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
7 changes: 6 additions & 1 deletion src/SeqCli/Cli/Commands/Forwarder/TruncateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

using System;
using System.IO;
using System.Threading.Tasks;
using SeqCli.Cli.Features;
using Serilog;
Expand All @@ -37,7 +38,11 @@ protected override async Task<int> Run(string[] args)
{
if (!_confirm.TryConfirm("All data in the forwarder's log buffer will be deleted. This cannot be undone."))
return 1;


foreach (var bufferStorageDirectory in Directory.GetDirectories(_storagePath.BufferPath))
{
Directory.Delete(bufferStorageDirectory, true);
}
return 0;
}
catch (Exception ex)
Expand Down
8 changes: 4 additions & 4 deletions src/SeqCli/Forwarder/Channel/ForwardingChannelMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ ForwardingChannel OpenOrCreateChannel(string? apiKey, string name)
// TODO, when it's not the default, persist the API key and validate equality on reopen

var storePath = Path.Combine(_bufferPath, name);
var defaultStore = new SystemStoreDirectory(storePath);
var store = new SystemStoreDirectory(storePath);
Log.Information("Opening local buffer in {StorePath}", storePath);

return new ForwardingChannel(
BufferAppender.Open(defaultStore),
BufferReader.Open(defaultStore),
Bookmark.Open(defaultStore),
BufferAppender.Open(store),
BufferReader.Open(store),
Bookmark.Open(store),
_connection,
apiKey,
_shutdownTokenSource.Token);
Expand Down
2 changes: 1 addition & 1 deletion src/SeqCli/Forwarder/Storage/BufferAppender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static BufferAppender Open(StoreDirectory storeDirectory)
}

/// <summary>
/// Try write a batch.
/// Try to write a batch.
///
/// This method does not throw.
///
Expand Down