Skip to content

Commit 595c5ee

Browse files
committed
Avoid registering for a callback notification when I don't want to be master anyway
1 parent 1ab5328 commit 595c5ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

service/runtime_cluster_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func (s *runtimeClusterManager) Run(ctx context.Context, log *logging.Logger, ru
272272
s.mutex.Unlock()
273273

274274
// Register master changed callback (if needed)
275-
if !callbackRegistered && masterURL != "" {
275+
if !callbackRegistered && masterURL != "" && !s.avoidBeingMaster {
276276
log.Debug("Register master callback...")
277277
if err := s.registerMasterChangedCallback(ctx, ownURL); err != nil {
278278
log.Debugf("Failed to register master callback: %#v", err)

0 commit comments

Comments
 (0)