mirror of
https://github.com/Luzifer/discord-community.git
synced 2024-11-09 23:50:04 +00:00
Fix: Do not break posting on one non-fresh stream
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
56fab109a1
commit
55e0777507
1 changed files with 10 additions and 2 deletions
|
@ -120,9 +120,17 @@ func (m modLivePosting) fetchAndPostForUsername(usernames ...string) error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if time.Since(stream.StartedAt) > streamFreshness {
|
isFresh := time.Since(stream.StartedAt) <= streamFreshness
|
||||||
|
|
||||||
|
log.WithFields(log.Fields{
|
||||||
|
"isFresh": isFresh,
|
||||||
|
"started_at": stream.StartedAt,
|
||||||
|
"user": user.DisplayName,
|
||||||
|
}).Trace("Found user / stream combination")
|
||||||
|
|
||||||
|
if !isFresh {
|
||||||
// Stream is too old, don't annoounce
|
// Stream is too old, don't annoounce
|
||||||
return nil
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = m.sendLivePost(
|
if err = m.sendLivePost(
|
||||||
|
|
Loading…
Reference in a new issue