diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-02-13 17:19:55 +0100 |
|---|---|---|
| committer | Bond-009 <bond.009@outlook.com> | 2019-02-16 00:43:56 +0100 |
| commit | be77e14db96b709fc0dc212258c3389a210e1af4 (patch) | |
| tree | 91ef4b730166caa372a16e1d9c94f256af8a51ff | |
| parent | 34af7501fa33f807aa7e721a95294b623f2d4d6c (diff) | |
Warnings for docs
| -rw-r--r-- | Jellyfin.Server/Jellyfin.Server.csproj | 3 | ||||
| -rw-r--r-- | Jellyfin.Server/Program.cs | 40 | ||||
| -rw-r--r-- | Jellyfin.Server/SocketSharp/RequestMono.cs | 2 | ||||
| -rw-r--r-- | Jellyfin.Server/SocketSharp/SharpWebSocket.cs | 1 |
4 files changed, 26 insertions, 20 deletions
diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj index fe1397bcb..a6bf23f5b 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj +++ b/Jellyfin.Server/Jellyfin.Server.csproj @@ -5,11 +5,14 @@ <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.1</TargetFramework> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> + <GenerateDocumentationFile>true</GenerateDocumentationFile> </PropertyGroup> <PropertyGroup> <!-- We need C# 7.1 for async main--> <LangVersion>latest</LangVersion> + <!-- Disable ducumentation warnings (for now) --> + <NoWarn>SA1600</NoWarn> </PropertyGroup> <ItemGroup> diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 6dfabc364..ac5aab460 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -57,6 +57,21 @@ namespace Jellyfin.Server errs => Task.FromResult(0)).ConfigureAwait(false); } + public static void Shutdown() + { + if (!_tokenSource.IsCancellationRequested) + { + _tokenSource.Cancel(); + } + } + + public static void Restart() + { + _restartOnShutdown = true; + + Shutdown(); + } + private static async Task StartApp(StartupOptions options) { ServerApplicationPaths appPaths = CreateApplicationPaths(options); @@ -76,6 +91,7 @@ namespace Jellyfin.Server { return; // Already shutting down } + e.Cancel = true; _logger.LogInformation("Ctrl+C, shutting down"); Environment.ExitCode = 128 + 2; @@ -89,6 +105,7 @@ namespace Jellyfin.Server { return; // Already shutting down } + _logger.LogInformation("Received a SIGTERM signal, shutting down"); Environment.ExitCode = 128 + 15; Shutdown(); @@ -102,7 +119,7 @@ namespace Jellyfin.Server SQLitePCL.Batteries_V2.Init(); // Allow all https requests - ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; }); + ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; } ); var fileSystem = new ManagedFileSystem(_loggerFactory, environmentInfo, null, appPaths.TempDirectory, true); @@ -146,7 +163,7 @@ namespace Jellyfin.Server /// for everything else the XDG approach is followed: /// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html /// </summary> - /// <param name="options"></param> + /// <param name="options">StartupOptions</param> /// <returns>ServerApplicationPaths</returns> private static ServerApplicationPaths CreateApplicationPaths(StartupOptions options) { @@ -308,6 +325,7 @@ namespace Jellyfin.Server await rscstr.CopyToAsync(fstr).ConfigureAwait(false); } } + var configuration = new ConfigurationBuilder() .SetBasePath(appPaths.ConfigurationDirectoryPath) .AddJsonFile("logging.json") @@ -335,7 +353,7 @@ namespace Jellyfin.Server } } - public static IImageEncoder GetImageEncoder( + private static IImageEncoder GetImageEncoder( IFileSystem fileSystem, IApplicationPaths appPaths, ILocalizationManager localizationManager) @@ -376,26 +394,12 @@ namespace Jellyfin.Server { return MediaBrowser.Model.System.OperatingSystem.BSD; } + throw new Exception($"Can't resolve OS with description: '{osDescription}'"); } } } - public static void Shutdown() - { - if (!_tokenSource.IsCancellationRequested) - { - _tokenSource.Cancel(); - } - } - - public static void Restart() - { - _restartOnShutdown = true; - - Shutdown(); - } - private static void StartNewInstance(StartupOptions options) { _logger.LogInformation("Starting new instance"); diff --git a/Jellyfin.Server/SocketSharp/RequestMono.cs b/Jellyfin.Server/SocketSharp/RequestMono.cs index 4bb2e8e19..584d38bcb 100644 --- a/Jellyfin.Server/SocketSharp/RequestMono.cs +++ b/Jellyfin.Server/SocketSharp/RequestMono.cs @@ -82,9 +82,7 @@ namespace Jellyfin.Server.SocketSharp } else { - // // We use a substream, as in 2.x we will support large uploads streamed to disk, - // var sub = new HttpPostedFile(e.Filename, e.ContentType, input, e.Start, e.Length); files[e.Name] = sub; } diff --git a/Jellyfin.Server/SocketSharp/SharpWebSocket.cs b/Jellyfin.Server/SocketSharp/SharpWebSocket.cs index e7e36e31b..5b233cdf5 100644 --- a/Jellyfin.Server/SocketSharp/SharpWebSocket.cs +++ b/Jellyfin.Server/SocketSharp/SharpWebSocket.cs @@ -55,6 +55,7 @@ namespace Jellyfin.Server.SocketSharp void socket_OnError(object sender, SocketHttpListener.ErrorEventArgs e) { _logger.LogError("Error in SharpWebSocket: {Message}", e.Message ?? string.Empty); + // Closed?.Invoke(this, EventArgs.Empty); } |
