From 33f8415412d3da1190cce9bed91fbf8a0ce8a175 Mon Sep 17 00:00:00 2001 From: WashingtonKK Date: Thu, 19 Sep 2024 22:27:18 +0300 Subject: [PATCH] add disconnected status Signed-off-by: WashingtonKK --- manager/agentEventsLogs.go | 4 ++-- pkg/manager/manager_states.go | 1 + pkg/manager/managerstatus_string.go | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/manager/agentEventsLogs.go b/manager/agentEventsLogs.go index 9e0cc3bf..aa38a31e 100644 --- a/manager/agentEventsLogs.go +++ b/manager/agentEventsLogs.go @@ -119,9 +119,9 @@ func (ms *managerService) reportBrokenConnection(cmpID string) { ms.eventsChan <- &manager.ClientStreamMessage{ Message: &manager.ClientStreamMessage_AgentEvent{ AgentEvent: &manager.AgentEvent{ - EventType: "vm running", + EventType: manager.VmRunning.String(), ComputationId: cmpID, - Status: "disconnected", + Status: manager.Disconnected.String(), Timestamp: timestamppb.Now(), Originator: "manager", }, diff --git a/pkg/manager/manager_states.go b/pkg/manager/manager_states.go index d972b02c..9f1f8ec1 100644 --- a/pkg/manager/manager_states.go +++ b/pkg/manager/manager_states.go @@ -18,4 +18,5 @@ const ( Starting ManagerStatus = iota Stopped Error + Disconnected ) diff --git a/pkg/manager/managerstatus_string.go b/pkg/manager/managerstatus_string.go index 0289df2d..5ddb2206 100644 --- a/pkg/manager/managerstatus_string.go +++ b/pkg/manager/managerstatus_string.go @@ -11,11 +11,12 @@ func _() { _ = x[Starting-0] _ = x[Stopped-1] _ = x[Error-2] + _ = x[Disconnected-3] } -const _ManagerStatus_name = "StartingStoppedError" +const _ManagerStatus_name = "StartingStoppedErrorDisconnected" -var _ManagerStatus_index = [...]uint8{0, 8, 15, 20} +var _ManagerStatus_index = [...]uint8{0, 8, 15, 20, 32} func (i ManagerStatus) String() string { if i >= ManagerStatus(len(_ManagerStatus_index)-1) {