Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Hiltunen <shiltunen@gitlab.com>2021-11-18 21:29:26 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2021-11-25 14:15:19 +0300
commit68c4b25aa4b7f0745d6e0887bbc352e6a9753092 (patch)
treec3a914ba6b3c12f8ce690cb13dcac81973df688e
parent7952c3ab75aed8cf187a249cfb789478492d705f (diff)
Simplify HealthManager first update send
HealthManager is now only sending an update on the first update. This notification is used by Praefect in the main to ensure the first round of health checks have been performed before proceeding to start the servers. As we only ever send to the channel once and it is buffered, this simplifies the send by removing the default case as this never blocks.
-rw-r--r--internal/praefect/nodes/health_manager.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/internal/praefect/nodes/health_manager.go b/internal/praefect/nodes/health_manager.go
index 1d1308df0..32f174533 100644
--- a/internal/praefect/nodes/health_manager.go
+++ b/internal/praefect/nodes/health_manager.go
@@ -154,10 +154,7 @@ ON CONFLICT (praefect_name, shard_name, node_name)
if hm.firstUpdate {
hm.firstUpdate = false
- select {
- case hm.updated <- struct{}{}:
- default:
- }
+ hm.updated <- struct{}{}
}
return nil