From 026aeb6399288d669ed07045b05ad81c60ab1392 Mon Sep 17 00:00:00 2001 From: Jordan Shaw Date: Mon, 15 Mar 2021 22:18:27 -0400 Subject: [PATCH] Update index.js added an upload timeout to prevent hitting the shopify api request limit --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2f67319..dd7f064 100644 --- a/index.js +++ b/index.js @@ -304,9 +304,11 @@ function gulpShopifyUpload(apiKey, password, host, themeid, options) { callback(null, file); } else { if (file.isBuffer()) { - shopify.upload(file.path, file, host, '', themeid, function () { + var upload_callback = function () { callback(null, file); - }); + }; + + setTimeout(shopify.upload.bind(null, file.path, file, host, '', themeid, upload_callback), 300); } // file is null if it was just deleted, so destroy it on Shopify