diff --git a/jobs/clan_monitor_job.go b/jobs/clan_monitor_job.go index 595d578..c93c35d 100644 --- a/jobs/clan_monitor_job.go +++ b/jobs/clan_monitor_job.go @@ -83,12 +83,16 @@ func (j *ClanMonitorJob) Run(ctx context.Context) error { } if len(members) == 0 { + log.Printf("clan monitor: no members returned for clan %s", j.clanTag) return nil } + log.Printf("clan monitor: fetched %d members for clan %s", len(members), j.clanTag) + var inactive []inactiveMember for _, member := range members { if member.LastSeen.IsZero() { + log.Printf("clan monitor: missing lastSeen for %s (%s); skipping", member.Name, member.Tag) continue } @@ -102,6 +106,7 @@ func (j *ClanMonitorJob) Run(ctx context.Context) error { } if len(inactive) == 0 { + log.Printf("clan monitor: no members inactive ≥ %s", formatDuration(offlineThreshold)) return nil } @@ -114,6 +119,7 @@ func (j *ClanMonitorJob) Run(ctx context.Context) error { var newlyInactive []inactiveMember for _, member := range inactive { if _, alreadyNotified := j.notified[member.Tag]; alreadyNotified { + log.Printf("clan monitor: already notified inactivity for %s (%s); skipping DM", member.Name, member.Tag) continue } @@ -123,6 +129,7 @@ func (j *ClanMonitorJob) Run(ctx context.Context) error { } if len(newlyInactive) == 0 { + log.Printf("clan monitor: no new inactive members to notify (all %d already handled)", len(inactive)) return nil }