1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-26 00:33:03 +02:00

Bump version, add more details to rate_visitor logs

This commit is contained in:
binwiederhier 2023-02-25 21:09:10 -05:00
parent f4772b0c75
commit 0967414f79
6 changed files with 56 additions and 65 deletions

View file

@ -35,17 +35,7 @@ func (s *Server) execManager() {
defer s.mu.Unlock()
for _, t := range s.topics {
subs := t.SubscribersCount()
ev := log.Tag(tagManager)
if ev.IsTrace() {
vrate := t.RateVisitor()
if vrate != nil {
ev.Fields(log.Context{
"rate_visitor_ip": vrate.IP(),
"rate_visitor_user_id": vrate.MaybeUserID(),
})
}
ev.With(t).Trace("- topic %s: %d subscribers", t.ID, subs)
}
log.Tag(tagManager).With(t).Trace("- topic %s: %d subscribers", t.ID, subs)
msgs, exists := messageCounts[t.ID]
if t.Stale() && (!exists || msgs == 0) {
log.Tag(tagManager).With(t).Trace("Deleting empty topic %s", t.ID)