@@ -63,15 +63,15 @@ export class PubSubClient {
6363 private readonly pool : Pool ,
6464 private readonly opts : Required < PostgresAdapterOptions > ,
6565 private readonly isFromSelf : ( msg : ExtendedClusterMessage ) => boolean ,
66- private readonly onMessage : ( msg : ClusterMessage ) => void
66+ private readonly onMessage : ( msg : ClusterMessage ) => void ,
6767 ) {
6868 this . initClient ( ) . then ( ( ) => { } ) ; // ignore error
6969
7070 this . cleanupTimer = setInterval ( async ( ) => {
7171 try {
7272 debug ( "removing old events" ) ;
7373 await pool . query (
74- `DELETE FROM ${ opts . tableName } WHERE created_at < now() - interval '${ opts . cleanupInterval } milliseconds'`
74+ `DELETE FROM ${ opts . tableName } WHERE created_at < now() - interval '${ opts . cleanupInterval } milliseconds'` ,
7575 ) ;
7676 } catch ( err ) {
7777 opts . errorHandler ( err as Error ) ;
@@ -84,7 +84,7 @@ export class PubSubClient {
8484 debug ( "reconnection in %d ms" , reconnectionDelay ) ;
8585 this . reconnectTimer = setTimeout (
8686 ( ) => this . initClient ( ) ,
87- reconnectionDelay
87+ reconnectionDelay ,
8888 ) ;
8989 }
9090
@@ -97,7 +97,7 @@ export class PubSubClient {
9797 client . on ( "notification" , async ( msg : Notification ) => {
9898 try {
9999 let message = JSON . parse (
100- msg . payload as string
100+ msg . payload as string ,
101101 ) as ExtendedClusterMessage ;
102102
103103 if ( this . isFromSelf ( message ) ) {
@@ -107,10 +107,10 @@ export class PubSubClient {
107107 if ( message . attachmentId ) {
108108 const result = await this . pool . query (
109109 `SELECT payload FROM ${ this . opts . tableName } WHERE id = $1` ,
110- [ message . attachmentId ]
110+ [ message . attachmentId ] ,
111111 ) ;
112112 const fullMessage = decode (
113- result . rows [ 0 ] . payload
113+ result . rows [ 0 ] . payload ,
114114 ) as ExtendedClusterMessage ;
115115 this . onMessage ( fullMessage ) ;
116116 } else {
@@ -184,19 +184,19 @@ export class PubSubClient {
184184 }
185185
186186 private async publishWithAttachment (
187- message : ClusterMessage | ClusterResponse
187+ message : ClusterMessage | ClusterResponse ,
188188 ) {
189189 const payload = encode ( message ) ;
190190 const channel = `${ this . opts . channelPrefix } #${ message . nsp } ` ;
191191
192192 debug (
193193 "sending event of type %s with attachment to channel %s" ,
194194 message . type ,
195- channel
195+ channel ,
196196 ) ;
197197 const result = await this . pool . query (
198198 `INSERT INTO ${ this . opts . tableName } (payload) VALUES ($1) RETURNING id;` ,
199- [ payload ]
199+ [ payload ] ,
200200 ) ;
201201 const attachmentId = result . rows [ 0 ] . id ;
202202 const headerPayload = JSON . stringify ( {
0 commit comments