Socket
Socket
Sign inDemoInstall

flickr-cli

Package Overview
Dependencies
115
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.5 to 1.0.6

src/utils/retry.js

2

package.json
{
"name": "flickr-cli",
"version": "1.0.5",
"version": "1.0.6",
"description": "command line interface for flickr",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,1 +1,5 @@

const {RetryPolicies, Retry} = require("../utils/retry");
const retry = new Retry(5, 1000, RetryPolicies.exponential);
const upload = async (params, config, flickr) => {

@@ -5,3 +9,3 @@ for (const file of params.files) {

try {
const res = await flickr.upload(file);
const res = await retry.retry(async () => await flickr.upload(file));
process.stdout.write(` OK - photoid: ${res.photoid._content}\n`);

@@ -11,3 +15,3 @@ }

{
console.error(error);
console.error(`Failed to upload ${file}: ${error.message}`);
}

@@ -14,0 +18,0 @@ }

@@ -18,2 +18,13 @@ const td = require("testdouble");

});
it("should retry 5 times", async function () {
this.timeout(16000);
const flickr = td.object(["upload"]);
const file = "ljhkjh";
td.when(flickr.upload(file)).thenReject(Error("bla"));
await upload({files: [file]}, {}, flickr);
td.verify(flickr.upload(file), {times: 5});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc