Fix some checks
This commit is contained in:
parent
1f45d5bdec
commit
e1603932aa
1 changed files with 23 additions and 17 deletions
|
@ -50,6 +50,7 @@ func (portal *Portal) missedForwardBackfill(user *User, lastMessageTS time.Time,
|
|||
Str("action", "missed forward backfill").
|
||||
Logger()
|
||||
ctx := log.WithContext(context.TODO())
|
||||
if !lastMessageTS.IsZero() {
|
||||
if portal.lastMessageTS.IsZero() {
|
||||
lastMsg, err := portal.bridge.DB.Message.GetLastInChat(ctx, portal.Key)
|
||||
if err != nil {
|
||||
|
@ -69,6 +70,7 @@ func (portal *Portal) missedForwardBackfill(user *User, lastMessageTS time.Time,
|
|||
Msg("Nothing to backfill")
|
||||
return
|
||||
}
|
||||
}
|
||||
log.Info().
|
||||
Time("latest_message_ts", lastMessageTS).
|
||||
Str("latest_message_id", lastMessageID).
|
||||
|
@ -115,6 +117,10 @@ func (portal *Portal) forwardBackfill(ctx context.Context, user *User, after tim
|
|||
}
|
||||
}
|
||||
}
|
||||
if len(converted) == 0 {
|
||||
log.Debug().Msg("Didn't get any converted messages")
|
||||
return
|
||||
}
|
||||
log.Debug().
|
||||
Int("converted_count", len(converted)).
|
||||
Msg("Converted messages for backfill")
|
||||
|
|
Loading…
Reference in a new issue