diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-10-01 15:05:43 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-10-01 15:05:43 -0500 |
| commit | 36b1e1d4537d817d7a02987a25e5f0cc792d5f8f (patch) | |
| tree | 36f8446732e995388b3c9f322044f220e8d81ca8 /src/slskd/Application.cs | |
| parent | 664a3e988a0f0beb2f5a75602ea468d339ac87a6 (diff) | |
| download | slskd-36b1e1d4537d817d7a02987a25e5f0cc792d5f8f.tar.gz | |
respect force scan option, gracefully handle init failures
Diffstat (limited to 'src/slskd/Application.cs')
| -rw-r--r-- | src/slskd/Application.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index 2a52f2f5..57f968ec 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -371,11 +371,16 @@ namespace slskd _ = CheckVersionAsync(); } - // initialize shares. most of the time shares will be loaded from disk, but - // if this is the first run or the user deleted cached files, a full scan will be performed if (!OptionsAtStartup.Flags.NoShareScan) { - await Shares.InitializeAsync(forceRescan: OptionsAtStartup.Flags.ForceShareScan); + try + { + await Shares.InitializeAsync(forceRescan: OptionsAtStartup.Flags.ForceShareScan); + } + catch (Exception) + { + Log.Error("Failed to initialize shares. Sharing is disabled"); + } } if (OptionsAtStartup.Flags.NoConnect) |
