pg#ClientConfig TypeScript Examples

The following examples show how to use pg#ClientConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: postgres-notifier.ts    From stacks-blockchain-api with GNU General Public License v3.0 6 votes vote down vote up
constructor(clientConfig: ClientConfig) {
    this.subscriber = createPostgresSubscriber(clientConfig, {
      native: false,
      paranoidChecking: 30000, // 30s
      retryLimit: Infinity, // Keep trying until it works or the API shuts down
      retryTimeout: Infinity,
      retryInterval: attempt => {
        const retryMs = 1000;
        logger.info(`PgNotifier reconnection attempt ${attempt}, trying again in ${retryMs}ms`);
        return retryMs;
      },
    });
  }