From a0476551cf8da20cbc51361d20a28a3b12bd4395 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 10 Oct 2022 17:30:39 -0500 Subject: add BackupTo() --- src/slskd/Shares/IShareService.cs | 8 ++++++-- src/slskd/Shares/ShareService.cs | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Shares/IShareService.cs b/src/slskd/Shares/IShareService.cs index f8e2076d..5144ada8 100644 --- a/src/slskd/Shares/IShareService.cs +++ b/src/slskd/Shares/IShareService.cs @@ -15,8 +15,6 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // -using System.IO; - namespace slskd.Shares { using System.Collections.Generic; @@ -38,6 +36,12 @@ namespace slskd.Shares /// public IStateMonitor StateMonitor { get; } + /// + /// Backs contents of the cache up to the specified file. + /// + /// The destination connection string. + void BackupTo(string connectionString); + /// /// Returns the entire contents of the share. /// diff --git a/src/slskd/Shares/ShareService.cs b/src/slskd/Shares/ShareService.cs index 2b761965..23917535 100644 --- a/src/slskd/Shares/ShareService.cs +++ b/src/slskd/Shares/ShareService.cs @@ -98,6 +98,15 @@ namespace slskd.Shares private StorageMode CacheStorageMode { get; } private ILogger Log { get; } = Serilog.Log.ForContext(); + /// + /// Backs contents of the cache up to the specified file. + /// + /// The destination connection string. + public void BackupTo(string connectionString) + { + Repository.BackupTo(connectionString); + } + /// /// Returns the entire contents of the share. /// -- cgit v1.2.3