mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Update MainForm.cs, HeartbeatClient.cs
This commit is contained in:
parent
86916d2ed9
commit
641c2070a4
|
@ -211,7 +211,10 @@ namespace WelsonJS.Launcher
|
||||||
|
|
||||||
private void userdefinedVariablesToolStripMenuItem_Click(object sender, EventArgs e)
|
private void userdefinedVariablesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
(new EnvForm()).Show();
|
using (var envForm = new EnvForm())
|
||||||
|
{
|
||||||
|
envForm.Show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace WelsonJS.Service
|
||||||
{
|
{
|
||||||
private readonly HeartbeatService.HeartbeatServiceClient _client;
|
private readonly HeartbeatService.HeartbeatServiceClient _client;
|
||||||
private readonly GrpcChannel _channel;
|
private readonly GrpcChannel _channel;
|
||||||
private const int HeartbeatInterval = 2000; // 2 seconds
|
private int HeartbeatInterval;
|
||||||
private ServiceMain _parent;
|
private ServiceMain _parent;
|
||||||
private string clientId;
|
private string clientId;
|
||||||
private string serverAddress;
|
private string serverAddress;
|
||||||
|
@ -25,6 +25,8 @@ namespace WelsonJS.Service
|
||||||
{
|
{
|
||||||
_parent = (ServiceMain)parent;
|
_parent = (ServiceMain)parent;
|
||||||
|
|
||||||
|
HeartbeatInterval = int.Parse(_parent.GetSettingsHandler().Read("HEARTBEAT_INTERVAL", "Service") ?? "2000");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
serverAddress = _parent.GetSettingsHandler().Read("GRPC_HOST", "Service");
|
serverAddress = _parent.GetSettingsHandler().Read("GRPC_HOST", "Service");
|
||||||
|
@ -69,7 +71,7 @@ namespace WelsonJS.Service
|
||||||
await call.RequestStream.CompleteAsync();
|
await call.RequestStream.CompleteAsync();
|
||||||
_parent.Log("Sent heartbeat");
|
_parent.Log("Sent heartbeat");
|
||||||
|
|
||||||
await Task.Delay(HeartbeatInterval); // HeartbeatInterval 동안 대기
|
await Task.Delay(HeartbeatInterval); // Wait for HeartbeatInterval
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user