From 621e9dc0acc8ef663f4c2802e65673fdd59ea2fe Mon Sep 17 00:00:00 2001 From: mckrava Date: Mon, 18 Sep 2023 14:23:29 +0300 Subject: [PATCH] fix: added additional logs --- src/providers/api.provider.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/providers/api.provider.ts b/src/providers/api.provider.ts index 3fbcf2a..76d6227 100644 --- a/src/providers/api.provider.ts +++ b/src/providers/api.provider.ts @@ -16,6 +16,21 @@ export const ApiProviders: Provider[] = [ }); // const substrateApi = await api.substrateApi; logger.info('Api created'); + const substrateApi = await api.substrateApi; + + substrateApi.on('error', (e) => + logger.info('Subsocial SubstateApi ERROR - ', e) + ); + substrateApi.on('connected', () => + logger.info('Subsocial SubstateApi connected') + ); + substrateApi.on('disconnected', () => + logger.info('Subsocial SubstateApi disconnected') + ); + substrateApi.on('ready', () => + logger.info('Subsocial SubstateApi ready') + ); + return api; }, inject: [xSocialConfig] @@ -29,7 +44,7 @@ export const ApiProviders: Provider[] = [ url: `${env.DATA_PROVIDER_SQUID_WS_URL}`, retryAttempts: Infinity, shouldRetry: () => true, - keepAlive: 10000, + keepAlive: 10000 }); client.on('error', (e) => logger.info('WS Api ERROR - ', e)); client.on('connecting', () => logger.info('WS Api connecting'));