mirror of
https://github.com/christianselig/apollo-backend
synced 2024-12-23 06:45:27 +00:00
only set before if last message id has contents
This commit is contained in:
parent
ff27f2323d
commit
badda4f191
1 changed files with 6 additions and 4 deletions
|
@ -248,10 +248,12 @@ func (nc *notificationsConsumer) Consume(delivery rmq.Delivery) {
|
|||
nc.logger.WithFields(logrus.Fields{
|
||||
"accountID": id,
|
||||
}).Debug("fetching message inbox")
|
||||
msgs, err := rac.MessageInbox(
|
||||
reddit.WithQuery("limit", "10"),
|
||||
reddit.WithQuery("before", account.LastMessageID),
|
||||
)
|
||||
|
||||
opts := []reddit.RequestOption{reddit.WithQuery("limit", "10")}
|
||||
if account.LastMessageID != "" {
|
||||
opts = append(opts, reddit.WithQuery("before", account.LastMessageID))
|
||||
}
|
||||
msgs, err := rac.MessageInbox(opts...)
|
||||
|
||||
if err != nil {
|
||||
nc.logger.WithFields(logrus.Fields{
|
||||
|
|
Loading…
Reference in a new issue