瀏覽代碼

changed connection close from 25 to 50 sceonds

Scrublord1336 6 年之前
父節點
當前提交
2593f8bf68
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/XUnity.AutoTranslator.Plugin.Core/Web/KnownHttpEndpoint.cs

+ 2 - 2
src/XUnity.AutoTranslator.Plugin.Core/Web/KnownHttpEndpoint.cs

@@ -8,7 +8,7 @@ namespace XUnity.AutoTranslator.Plugin.Core.Web
 {
    public abstract class KnownHttpEndpoint : IKnownEndpoint
    {
-      private static readonly TimeSpan MaxUnusedLifespan = TimeSpan.FromSeconds( 25 );
+      private static readonly TimeSpan MaxUnusedLifespan = TimeSpan.FromSeconds( 50 );
 
       private ServicePoint[] _servicePoints;
       private bool _isBusy = false;
@@ -118,7 +118,7 @@ namespace XUnity.AutoTranslator.Plugin.Core.Web
          if( !_isBusy && _clientLastUse.HasValue && DateTime.UtcNow - _clientLastUse > MaxUnusedLifespan && !_client.IsBusy
             && _servicePoints != null && _servicePoints.Length > 0 )
          {
-            Logger.Current.Debug( "Closing service points because they were not used for 25 seconds." );
+            Logger.Current.Debug( $"Closing service points because they were not used for {(int)MaxUnusedLifespan.TotalSeconds} seconds." );
 
             _isBusy = true;
             _clientLastUse = null;