fly 8 months ago
parent
commit
87674ba378
2 changed files with 20 additions and 3 deletions
  1. 18 1
      src/WingServer.cs
  2. 2 2
      src/appsettings.json

+ 18 - 1
src/WingServer.cs

@@ -34,6 +34,8 @@ namespace WingCloudServer
         private static JsonRpcClientPool _rpcClientPool;
         private static Dictionary<string, IDynamicSlaveService> _remoteServices = new Dictionary<string, IDynamicSlaveService>();
 
+        private int _dongleValidinterval = 480;
+
         public WingServer(string host)
         {
             _rpcInProcessServer = new JsonRpcServer();
@@ -42,6 +44,7 @@ namespace WingCloudServer
             _rpcHttpServer = new JsonRpcServer();
             _jsonRpcHttpServerEngine = new JsonRpcHttpServerEngine(host);
             _rpcHttpServer.UseEngine(_jsonRpcHttpServerEngine);
+            _dongleValidinterval = GetDongleValidinterval();
             WatchingUSB();
             WatchingDongle();
         }
@@ -720,7 +723,7 @@ namespace WingCloudServer
                 {
                     while (true)
                     {
-                        await Task.Delay(TimeSpan.FromMinutes(10));
+                        await Task.Delay(TimeSpan.FromMinutes(_dongleValidinterval));
                         try
                         {
                             new DongleValidService().CheckAndVerifyLicense();
@@ -738,5 +741,19 @@ namespace WingCloudServer
             });
         }
 
+        private int GetDongleValidinterval()
+        {
+            var dongleValidinterval = 480;
+            try
+            {
+                dongleValidinterval = ConfigurationManager.GetParammeter<IntParameter>("General", "DongleValidinterval").Value;
+            }
+            catch (Exception ex)
+            {
+                Logger.WriteLineError($"GetDongleValidinterval error:{ex}");
+            }
+            return dongleValidinterval;
+        }
+
     }
 }

+ 2 - 2
src/appsettings.json

@@ -5,12 +5,12 @@
     "IsMaster": false,
     "MasterUrl": "",
     "ServerID":"1",
-    "NotValidateLicense":true,
+    "NotValidateLicense":false,
     "QualityControlSwitch": false,
     "IsScreenshot": false,
     "NotVinnoServerService":false,
 	  "ApiAccessSwitch":false,
-	  "IsResearchEditionService":false,
+	  "IsResearchEditionService":true,
 	  "FormatterHostAddress":false,
     "DllKey":"vinno123"
   },