From 82979a3023c03f2226cb46a2ef4a8c46490cf34c Mon Sep 17 00:00:00 2001 From: yuanruji Date: Mon, 25 Nov 2024 15:43:49 +0800 Subject: [PATCH] 6666 --- .../mysql/db-simulation/app/service/simulation_task.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dbm-services/mysql/db-simulation/app/service/simulation_task.go b/dbm-services/mysql/db-simulation/app/service/simulation_task.go index 7d2aa1684a..281bd68e22 100644 --- a/dbm-services/mysql/db-simulation/app/service/simulation_task.go +++ b/dbm-services/mysql/db-simulation/app/service/simulation_task.go @@ -169,8 +169,11 @@ func init() { Password: config.GAppConfig.Redis.Password, DB: 0, }) - reloadRunningTaskFromdb() - rdb.Close() + go func() { + time.Sleep(time.Duration(HeartbeatInterval) * time.Second) + reloadRunningTaskFromdb() + rdb.Close() + }() } // ReloadParam TODO