Skip to content

Commit

Permalink
[TES-417] add more 2 minutes to ensure regenerate presinged url
Browse files Browse the repository at this point in the history
  • Loading branch information
HieuNguyenMinh-katalon committed Jan 9, 2024
1 parent 8575adb commit 7387d8f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config/transports.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class S3FileTransport extends TransportStream {
const dateFormart = 'YYYYMMDDTHHmmss[Z]';
const dateExpires = moment.utc(amzDate, dateFormart).toDate();
dateExpires.setSeconds(dateExpires.getSeconds(), amzExpires * 1000);
// Minus more 2 minutes to ensure regenerate presigned url
dateExpires.setSeconds(dateExpires.getSeconds(), -(2 * 60 * 1000));

const now = new Date();
if (dateExpires < now) {
Expand Down

0 comments on commit 7387d8f

Please sign in to comment.