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

@originlabs/graphql-postgres-subscriptions-retry

Package Overview
Dependencies
Maintainers
8
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@originlabs/graphql-postgres-subscriptions-retry - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

firebase-debug.log

2

package.json
{
"name": "@originlabs/graphql-postgres-subscriptions-retry",
"version": "2.1.0",
"version": "2.1.1",
"main": "index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -33,7 +33,18 @@ const { PubSub } = require("graphql-subscriptions");

async connect() {
await this.pgListen.connect();
await Promise.all(this.triggers.map((eventName) => {
return this.pgListen.listenTo(eventName);
}));
this.connected = true;
console.log('calling connect')
// confusingly, `pgListen.connect()` will reject if the first connection attempt fails
// but then it will retry and emit a `connected` event if it later connects
// see https://github.com/andywer/pg-listen/issues/32
// so we put logic on the `connected` event
this.pgListen.events.on('connected', async () => {
await Promise.all(this.triggers.map((eventName) => {
return this.pgListen.listenTo(eventName);
}));
this.connected = true;
});
try {
await this.pgListen.connect();
} catch (e) {
if (!e.message.includes('ECONNREFUSED')) throw e;
}
}

@@ -71,3 +82,3 @@

if (!this.connected) {
console.log('attempted to publish an event via pubsub, but client is not yet connected')
console.log('attempted to unsubscribe to events via pubsub, but client is not yet connected')
}

@@ -74,0 +85,0 @@

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