From 3963675e5dfbe5cf67488b220a3e822f35976925 Mon Sep 17 00:00:00 2001 From: ChrisLiu Date: Tue, 4 Jul 2023 11:28:43 +0800 Subject: [PATCH] enhance: decouple triggering network update from Gs Ready Signed-off-by: ChrisLiu --- pkg/controllers/gameserver/gameserver_manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controllers/gameserver/gameserver_manager.go b/pkg/controllers/gameserver/gameserver_manager.go index c7b96c4c..f0184511 100644 --- a/pkg/controllers/gameserver/gameserver_manager.go +++ b/pkg/controllers/gameserver/gameserver_manager.go @@ -149,7 +149,7 @@ func (manager GameServerManager) SyncGsToPod() error { } } - if gsState == gameKruiseV1alpha1.Ready && pod.Annotations[gameKruiseV1alpha1.GameServerNetworkType] != "" { + if pod.Annotations[gameKruiseV1alpha1.GameServerNetworkType] != "" { oldTime, err := time.Parse(TimeFormat, pod.Annotations[gameKruiseV1alpha1.GameServerNetworkTriggerTime]) if (err == nil && time.Since(oldTime) > NetworkIntervalTime && time.Since(gs.Status.NetworkStatus.LastTransitionTime.Time) < NetworkTotalWaitTime) || (pod.Annotations[gameKruiseV1alpha1.GameServerNetworkTriggerTime] == "") { newAnnotations[gameKruiseV1alpha1.GameServerNetworkTriggerTime] = time.Now().Format(TimeFormat)