Skip to content

Commit

Permalink
fix(smssync): ignore queued timestamp for pull transport
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Feb 28, 2020
1 parent c16871f commit 25f3888
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/message.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,14 @@ MessageSchema.methods.queue = function queue(done) {
const cb = _.isFunction(done) ? done : _.noop;

// update message details
this.queuedAt = new Date();
this.state = STATE_QUEUED;
if (this.mode === SEND_MODE_PULL) {
this.state = STATE_UNKNOWN;
this.sentAt = null;
this.queuedAt = null;
} else {
this.queuedAt = new Date();
this.state = STATE_QUEUED;
}

//persist message
this.save(function(error, message) {
Expand Down

0 comments on commit 25f3888

Please sign in to comment.