Fix: Do not break posting on one non-fresh stream

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-08-06 21:42:51 +02:00
parent 56fab109a1
commit 55e0777507
Signed by: luzifer
GPG Key ID: 0066F03ED215AD7D

View File

@ -120,9 +120,17 @@ func (m modLivePosting) fetchAndPostForUsername(usernames ...string) error {
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
return nil
continue
}
if err = m.sendLivePost(