diff --git a/indexer/src/providers/providerStatusProvider.ts b/indexer/src/providers/providerStatusProvider.ts index d071fd5e6..be25a3d77 100644 --- a/indexer/src/providers/providerStatusProvider.ts +++ b/indexer/src/providers/providerStatusProvider.ts @@ -6,7 +6,7 @@ import { ProviderSnapshot } from "@src/../../shared/dbSchemas/akash/providerSnap import { toUTC } from "@src/shared/utils/date"; const ConcurrentStatusCall = 10; -const StatusCallTimeout = 30_000; // 30 seconds +const StatusCallTimeout = 10_000; // 10 seconds export async function syncProvidersInfo() { let providers = await Provider.findAll({ @@ -91,11 +91,13 @@ export async function syncProvidersInfo() { }); } catch (err) { const checkDate = new Date(); + const errorMessage = err?.message?.toString() ?? err?.toString(); + await Provider.update( { isOnline: false, lastCheckDate: checkDate, - error: err?.message || err, + error: errorMessage, akashVersion: null, cosmosSdkVersion: null, deploymentCount: null, @@ -121,7 +123,7 @@ export async function syncProvidersInfo() { await ProviderSnapshot.create({ owner: provider.owner, isOnline: false, - error: err?.message || err, + error: errorMessage, checkDate: checkDate }); } finally { @@ -170,4 +172,4 @@ function sumResources(resources) { storage: 0 } ); -} \ No newline at end of file +}