Codota Logo For Javascript
async-retry
Code IndexAdd Codota to your IDE (free)

How to use async-retry

Best JavaScript code snippets using async-retry(Showing top 12 results out of 315)

origin: thenativeweb/wolkenkit-eventstore

const waitForPostgres = async function ({ url }) {
 if (!url) {
  throw new Error('Url is missing.');
 }

 const { host, port, user, password, database } = new DsnParser(url).getParts();

 const pool = new pg.Pool({ host, port, user, password, database });

 await retry(async () => {
  const connection = await pool.connect();

  connection.release();
 });

 await pool.end();
}
origin: thenativeweb/wolkenkit-eventstore

async getDatabase () {
  const database = await retry(async () => {
   const connection = await this.pool.getConnection();

   return connection;
  });

  return database;
 }
origin: thenativeweb/wolkenkit-eventstore

const waitForMongo = async function ({ url }) {
 if (!url) {
  throw new Error('Url is missing.');
 }

 await retry(async () => {
  /* eslint-disable id-length */
  const client = await MongoClient.connect(url, { w: 1, useNewUrlParser: true });
  /* eslint-enable id-length */

  await client.close();
 });
}
origin: thenativeweb/wolkenkit-eventstore

async getDatabase () {
  const database = await retry(async () => {
   const connection = await this.pool.acquire().promise;

   return connection;
  });

  return database;
 }
origin: synox/void-mail

async _connectWithRetry(configWithListener) {
    try {
      await retry(
        async _bail => {
          // If anything throws, we retry
          this.connection = await imaps.connect(configWithListener)

          this.connection.on('error', err => {
            // We assume that the app will be restarted after a crash.
            console.error(
              'got fatal error during imap operation, stop app.',
              err
            )
            this.emit('error', err)
          })

          await this.connection.openBox('INBOX')
          debug('connected to imap')
        },
        {
          retries: 5
        }
      )
    } catch (error) {
      console.error('can not connect, even with retry, stop app', error)
      throw error
    }
  }
origin: thenativeweb/wolkenkit-eventstore

this.client = await retry(async () => {
 const connection = await MongoClient.connect(url, { w: 1, useNewUrlParser: true });
origin: thenativeweb/wolkenkit-eventstore

await retry(async () => {
 await new Promise((resolve, reject) => {
  connection = new Connection(config);
origin: thenativeweb/wolkenkit-eventstore

await retry(async () => {
 await connection.query(`
  CREATE TABLE IF NOT EXISTS "${this.namespace}_events" (
origin: thenativeweb/wolkenkit-eventstore

async getDatabase () {
  const database = await retry(async () => {
   const connection = await this.pool.connect();

   return connection;
  });

  return database;
 }
origin: thenativeweb/wolkenkit-eventstore

const waitForMaria = async function ({ url }) {
 if (!url) {
  throw new Error('Url is missing.');
 }

 const { host, port, user, password, database } = new DsnParser(url).getParts();

 const pool = mysql.createPool({
  host,
  port,
  user,
  password,
  database
 });

 await retry(async () => {
  const connection = await pool.getConnection();

  await connection.release();
 });

 await pool.end();
}
origin: thenativeweb/wolkenkit-eventstore

async getDatabase () {
  const database = await retry(async () => {
   const connection = await this.pool.getConnection();

   return connection;
  });

  return database;
 }
origin: thenativeweb/wolkenkit-eventstore

const waitForMysql = async function ({ url }) {
 if (!url) {
  throw new Error('Url is missing.');
 }

 const { host, port, user, password, database } = new DsnParser(url).getParts();

 const pool = mysql.createPool({
  host,
  port,
  user,
  password,
  database
 });

 await retry(async () => {
  const connection = await pool.getConnection();

  await connection.release();
 });

 await pool.end();
}
async-retry(npm)

JSDoc

Retrying made simple, easy and async

Most used async-retry functions

  • retry

Popular in JavaScript

  • through2
    A tiny wrapper around Node.js streams.Transform (Streams2/3) to avoid explicit subclassing noise
  • ws
    Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
  • minimatch
    a glob matcher in javascript
  • fs-extra
    fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
  • express
    Fast, unopinionated, minimalist web framework
  • postcss
  • commander
    the complete solution for node.js command-line programs
  • async
    Higher-order functions and common patterns for asynchronous code
  • moment
    Parse, validate, manipulate, and display dates
  • Top plugins for WebStorm
    The challenge is finding the best plugins for JavaScript development on Intellij IDEs. Who wants to sit there and go over hundreds of plugins to pick the best?
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJavascript Code Index
Get Codota for your IDE now