diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs index 3a649b4..ce156dc 100644 --- a/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs +++ b/WelsonJS.Toolkit/WelsonJS.Launcher/MainForm.cs @@ -211,7 +211,10 @@ namespace WelsonJS.Launcher private void userdefinedVariablesToolStripMenuItem_Click(object sender, EventArgs e) { - (new EnvForm()).Show(); + using (var envForm = new EnvForm()) + { + envForm.Show(); + } } } } diff --git a/WelsonJS.Toolkit/WelsonJS.Service/HeartbeatClient.cs b/WelsonJS.Toolkit/WelsonJS.Service/HeartbeatClient.cs index d43d220..9ca715d 100644 --- a/WelsonJS.Toolkit/WelsonJS.Service/HeartbeatClient.cs +++ b/WelsonJS.Toolkit/WelsonJS.Service/HeartbeatClient.cs @@ -16,7 +16,7 @@ namespace WelsonJS.Service { private readonly HeartbeatService.HeartbeatServiceClient _client; private readonly GrpcChannel _channel; - private const int HeartbeatInterval = 2000; // 2 seconds + private int HeartbeatInterval; private ServiceMain _parent; private string clientId; private string serverAddress; @@ -25,6 +25,8 @@ namespace WelsonJS.Service { _parent = (ServiceMain)parent; + HeartbeatInterval = int.Parse(_parent.GetSettingsHandler().Read("HEARTBEAT_INTERVAL", "Service") ?? "2000"); + try { serverAddress = _parent.GetSettingsHandler().Read("GRPC_HOST", "Service"); @@ -69,7 +71,7 @@ namespace WelsonJS.Service await call.RequestStream.CompleteAsync(); _parent.Log("Sent heartbeat"); - await Task.Delay(HeartbeatInterval); // HeartbeatInterval λ™μ•ˆ λŒ€κΈ° + await Task.Delay(HeartbeatInterval); // Wait for HeartbeatInterval } catch (Exception ex)