Skip to content

Commit

Permalink
add sentat and originalTimestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
sayan-rudder committed Nov 21, 2019
1 parent 793f7ca commit d702578
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rudder-client-javascript/analytics/utils/EventRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class EventRepository {

this.payloadQueue = new Queue("rudder", queueOptions, function(item, done) {
// apply sentAt at flush time and reset on each retry
item.sentAt = getCurrentTimeFormatted();
item.message.sentAt = getCurrentTimeFormatted();
//send this item for processing, with a callback to enable queue to get the done status
eventRepository.processQueueElement(
item.url,
Expand Down Expand Up @@ -205,11 +205,13 @@ class EventRepository {
Authorization: "Basic " + btoa(this.writeKey + ":")
};

var message = rudderElement.getElementContent();
message.originalTimestamp = getCurrentTimeFormatted();
// add items to the queue
this.payloadQueue.addItem({
url: this.url + "/" + type,
headers: headers,
message: rudderElement.getElementContent()
message: message
});
}
}
Expand Down

0 comments on commit d702578

Please sign in to comment.