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:
parent
f4772b0c75
commit
0967414f79
6 changed files with 56 additions and 65 deletions
server
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue