mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-11-10 14:44:04 +08:00
Act as passive in maintenance mode, and claim no delayed messages
A node in maintenance mode now registers as passive (registry.SetRole at runtime), so peers stop counting it as a place for clients and leadership moves to the next active node; it is not ready, does not lead (at once, before its row says passive), and never fences. Its configured role is unchanged. It also claims no due delayed messages, which the next leader sends. Also tests that a drain duration of 0 is accepted.
This commit is contained in:
1 parent
b76ad0c037
commit
0a10a13511
11 files changed
+165
-18
No files matched your search
@@ -2187,6 +2187,9 @@ func (s *Server) runDelayedSender() {
|
||||
}
|
||||
|
||||
func (s *Server) sendDelayedMessages() error {
|
||||
if s.maintenance.Load() {
|
||||
return nil // On its way out: claiming now could leave a claimed message unsent; the next leader sends it
|
||||
}
|
||||
messages, err := s.messageCache.MessagesDue()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user