Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@collabland/common

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@collabland/common - npm Package Compare versions

Comparing version 0.10.0 to 0.11.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [0.11.0](https://github.com/abridged/collabland-monorepo/compare/@collabland/common@0.10.0...@collabland/common@0.11.0) (2021-04-28)
### Features
* add retry logic to make sure NEAR account creation reaches final ([d8bf6e7](https://github.com/abridged/collabland-monorepo/commit/d8bf6e7ca2220501b1c5b3a6f7fe5b503be809ce))
# [0.10.0](https://github.com/abridged/collabland-monorepo/compare/@collabland/common@0.9.0...@collabland/common@0.10.0) (2021-04-15)

@@ -8,0 +19,0 @@

24

dist/utils/promise-timeout.js

@@ -9,2 +9,4 @@ "use strict";

const util_1 = require("util");
const debug_1 = require("./debug");
const debug = debug_1.debugFactory('collabland:common');
/**

@@ -58,3 +60,5 @@ * Resolve a promise with timeout

try {
debug('Trying #%d', retries);
const result = await fn();
debug('Result', result);
if (!shouldRetry(undefined, result)) {

@@ -66,3 +70,5 @@ return result;

catch (err) {
debug('Error', err);
if (retries >= maxRetries) {
debug('Maximum number of retries (%d) has been reached', retries);
// Max number of retries reached

@@ -73,13 +79,15 @@ throw err;

// Let's fail
debug('No retry should happen');
throw err;
}
if (typeof waitInMs === 'function') {
wait = waitInMs(retries);
}
else {
wait = waitInMs;
}
await exports.sleep(wait);
++retries;
}
if (typeof waitInMs === 'function') {
wait = waitInMs(retries);
}
else {
wait = waitInMs;
}
debug('Waiting for %d milliseconds before next retry', wait);
await exports.sleep(wait);
++retries;
}

@@ -86,0 +94,0 @@ }

{
"name": "@collabland/common",
"version": "0.10.0",
"version": "0.11.0",
"description": "CollabLand common utilities",

@@ -56,3 +56,3 @@ "main": "dist/index.js",

"author": "Abridged, Inc.",
"gitHead": "92a9122fe027d96361461c2050484ee39d6a8107"
"gitHead": "b96d7e82853e4ef5478d5309b235fbf9a6b03dc5"
}

@@ -7,3 +7,6 @@ // Copyright Abridged, Inc. 2021. All Rights Reserved.

import {promisify} from 'util';
import {debugFactory} from './debug';
const debug = debugFactory('collabland:common');
/**

@@ -81,3 +84,5 @@ * Resolve a promise with timeout

try {
debug('Trying #%d', retries);
const result = await fn();
debug('Result', result);
if (!shouldRetry(undefined, result)) {

@@ -88,3 +93,5 @@ return result;

} catch (err) {
debug('Error', err);
if (retries >= maxRetries) {
debug('Maximum number of retries (%d) has been reached', retries);
// Max number of retries reached

@@ -95,13 +102,15 @@ throw err;

// Let's fail
debug('No retry should happen');
throw err;
}
if (typeof waitInMs === 'function') {
wait = waitInMs(retries);
} else {
wait = waitInMs;
}
await sleep(wait);
++retries;
}
if (typeof waitInMs === 'function') {
wait = waitInMs(retries);
} else {
wait = waitInMs;
}
debug('Waiting for %d milliseconds before next retry', wait);
await sleep(wait);
++retries;
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc