Skip to content

Commit

Permalink
Fix version comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Redm4x committed Feb 20, 2024
1 parent 963304f commit 6d2388b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions indexer/src/providers/providerStatusProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ export async function syncProvidersInfo() {
timeout: StatusCallTimeout
});

const versionStr = versionResponse.data.akash.version;
if (versionStr && semver.gte(versionStr, "0.5.0")) {
await grpcFetchAndSaveProviderStats(provider, versionResponse.data.akash.cosmosSdkVersion, versionResponse.data.akash.version, StatusCallTimeout);
const versionStr = semver.valid(versionResponse.data.akash.version);

if (versionStr && semver.gte(versionStr, "0.5.0-0")) {
await grpcFetchAndSaveProviderStats(provider, versionResponse.data.akash.cosmosSdkVersion, versionStr, StatusCallTimeout);
} else {
await restFetchAndSaveProviderStats(provider, versionResponse.data.akash.cosmosSdkVersion, versionResponse.data.akash.version, StatusCallTimeout);
await restFetchAndSaveProviderStats(provider, versionResponse.data.akash.cosmosSdkVersion, versionStr, StatusCallTimeout);
}
} catch (err) {
const checkDate = new Date();
Expand Down

0 comments on commit 6d2388b

Please sign in to comment.