Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Current minute rounded to floor
Browse files Browse the repository at this point in the history
  • Loading branch information
Serkan ÖZAL committed Jul 29, 2019
1 parent bac2cc6 commit f2afd34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Reporter {
envVariableKeys.THUNDRA_LAMBDA_REPORT_CLOUDWATCH_ENABLE) === 'true';

const reportPromises: any[] = [];
const currentMinute = Date.now() / 1000;
const currentMinute = Math.floor(Date.now() / 1000);
batchedReports.forEach((batch: any) => {
if (isAsync) {
reportPromises.push(this.writeBatchToCW(batch, isComposite));
Expand Down Expand Up @@ -170,7 +170,7 @@ class Reporter {
});
response.on('end', () => {
if (response.statusCode === 429) {
this.latestReportingLimitedMinute = Date.now() / 1000;
this.latestReportingLimitedMinute = Math.floor(Date.now() / 1000);
}
if (response.statusCode !== 200) {
ThundraLogger.getInstance().debug(JSON.stringify(this.reports));
Expand Down

0 comments on commit f2afd34

Please sign in to comment.