From 7751a58df38419d140be2a786fce6ea07aec0837 Mon Sep 17 00:00:00 2001 From: Gagan Date: Sun, 10 May 2026 00:56:03 +0530 Subject: [PATCH 1/2] feat: retry option added in gcp upload --- package.json | 4 ++-- src/cloudstorage.js | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fe65bc6..5ebe0d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tracker-utils", - "version": "1.6.11", + "version": "1.6.12", "description": "Tracker Utils", "main": "index.js", "scripts": { @@ -17,7 +17,7 @@ }, "dependencies": { "@google-cloud/pubsub": "^4.7.2", - "@google-cloud/storage": "^5.16.1", + "@google-cloud/storage": "^7.19.0", "axios": "^1.7.7", "bluebird": "^3.5.0", "ejs": "^3.1.6", diff --git a/src/cloudstorage.js b/src/cloudstorage.js index 0099b2a..3b4e7bd 100644 --- a/src/cloudstorage.js +++ b/src/cloudstorage.js @@ -1,5 +1,12 @@ // External and built-in deps const { Storage } = require('@google-cloud/storage'); +const gcpUploadRetryOpt = { + autoRetry: true, + maxRetries: 5, + retryDelayMultiplier: 2, + totalTimeout: 300, // seconds + maxRetryDelay: 60 // seconds +}; /** * Note: Environment should have GOOGLE_APPLICATION_CREDENTIALS set up. This has the path of service @@ -21,7 +28,7 @@ class CloudStorage { this.type = type; this.baseUrl = baseUrl; // TODO: Update this in future when aws will be used. - this.storage = new Storage(); + this.storage = new Storage({retryOptions: gcpUploadRetryOpt}); } /** From dc2d37bcdad6d27131805f090fecce97fa235222 Mon Sep 17 00:00:00 2001 From: Gagan Date: Sun, 10 May 2026 01:46:08 +0530 Subject: [PATCH 2/2] Update cloudstorage.js --- src/cloudstorage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cloudstorage.js b/src/cloudstorage.js index 3b4e7bd..863f0ea 100644 --- a/src/cloudstorage.js +++ b/src/cloudstorage.js @@ -4,8 +4,8 @@ const gcpUploadRetryOpt = { autoRetry: true, maxRetries: 5, retryDelayMultiplier: 2, - totalTimeout: 300, // seconds - maxRetryDelay: 60 // seconds + totalTimeout: 120000, // 120 seconds + maxRetryDelay: 30000 // 30 seconds }; /**