mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-10 22:17:44 +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{
|
nc.logger.WithFields(logrus.Fields{
|
||||||
"accountID": id,
|
"accountID": id,
|
||||||
}).Debug("fetching message inbox")
|
}).Debug("fetching message inbox")
|
||||||
msgs, err := rac.MessageInbox(
|
|
||||||
reddit.WithQuery("limit", "10"),
|
opts := []reddit.RequestOption{reddit.WithQuery("limit", "10")}
|
||||||
reddit.WithQuery("before", account.LastMessageID),
|
if account.LastMessageID != "" {
|
||||||
)
|
opts = append(opts, reddit.WithQuery("before", account.LastMessageID))
|
||||||
|
}
|
||||||
|
msgs, err := rac.MessageInbox(opts...)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
nc.logger.WithFields(logrus.Fields{
|
nc.logger.WithFields(logrus.Fields{
|
||||||
|
|
Loading…
Reference in a new issue