aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Shares/ShareService.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-10-01 17:24:34 -0500
committerJP Dillingham <jp@dillingham.me>2022-10-01 17:24:34 -0500
commit65bb516bd6d9d8caa262d5e3d1369f4221ab38dd (patch)
tree92eb88165ef26dbc91540f7ca6f761da1f8598b9 /src/slskd/Shares/ShareService.cs
parent36b1e1d4537d817d7a02987a25e5f0cc792d5f8f (diff)
downloadslskd-65bb516bd6d9d8caa262d5e3d1369f4221ab38dd.tar.gz
use correct logger
Diffstat (limited to 'src/slskd/Shares/ShareService.cs')
-rw-r--r--src/slskd/Shares/ShareService.cs16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/slskd/Shares/ShareService.cs b/src/slskd/Shares/ShareService.cs
index cebb15f6..4c107ed2 100644
--- a/src/slskd/Shares/ShareService.cs
+++ b/src/slskd/Shares/ShareService.cs
@@ -28,6 +28,7 @@ namespace slskd.Shares
using System.Threading;
using System.Threading.Tasks;
using Serilog;
+ using slskd.Transfers.Uploads;
using Soulseek;
/// <summary>
@@ -96,6 +97,7 @@ namespace slskd.Shares
private SemaphoreSlim SyncRoot { get; } = new SemaphoreSlim(1, 1);
private List<Regex> FilterRegexes { get; set; } = new List<Regex>();
private StorageMode CacheStorageMode { get; }
+ private ILogger Log { get; } = Serilog.Log.ForContext<ShareService>();
/// <summary>
/// Returns the entire contents of the share.
@@ -267,12 +269,18 @@ namespace slskd.Shares
Log.Warning("Share cache couldn't be loaded from backup");
await InitializeAsync(forceRescan: true);
}
+ else
+ {
+ Log.Debug("Share cache backup located. Attempting to restore...");
- Log.Debug("Share cache backup located. Attempting to restore...");
-
- Repository.RestoreFrom(connectionString: Program.ConnectionStrings.SharesBackup);
+ Repository.RestoreFrom(connectionString: Program.ConnectionStrings.SharesBackup);
- Log.Information("Share cache successfully restored from backup");
+ Log.Information("Share cache successfully restored from backup");
+ }
+ }
+ else
+ {
+ // the cache mode is disk and the existing db is valid. nothing to do.
}
// one of several thigns happened above before we got here: