Skip to content

Commit

Permalink
Merge pull request #1937 from w3f/fix
Browse files Browse the repository at this point in the history
Fix
  • Loading branch information
ironoa authored Aug 25, 2022
2 parents 2279543 + ae42f5d commit 35de5f8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion charts/otv-backend/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: 1K Validators Backend
name: otv-backend
version: v2.6.38
version: v2.6.39
apiVersion: v2
2 changes: 1 addition & 1 deletion charts/otv-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:

image:
repo: web3f/otv-backend
tag: v2.6.38
tag: v2.6.39

certificate:
enabled: true
Expand Down
4 changes: 2 additions & 2 deletions helmfile.d/10-otv-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ releases:
namespace: kusama
{{ if eq .Environment.Name "production" }}
chart: w3f/otv-backend
version: v2.6.38
version: v2.6.39
{{ else }}
chart: ../charts/otv-backend
{{ end }}
Expand All @@ -27,7 +27,7 @@ releases:
namespace: polkadot
{{ if eq .Environment.Name "production" }}
chart: w3f/otv-backend
version: v2.6.38
version: v2.6.39
{{ else }}
chart: ../charts/otv-backend
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "1k-validators-be",
"version": "2.6.38",
"version": "2.6.39",
"description": "Services for running the Thousand Validator Program.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { startClearAccumulatedOfflineTimeJob, startMonitorJob } from "./cron";

const isCI = process.env.CI;

const version = "v2.6.38";
const version = "v2.6.39";

const catchAndQuit = async (fn: any) => {
try {
Expand Down
34 changes: 20 additions & 14 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,25 @@ export const fetchLocationInfo = async (addr: any, iit: any) => {
return blank;
}

//@ts-ignore
const { city, region, country, loc, org, postal, timezone } = json;

if (!org) {
logger.info(`no org: ${json}`);
try {
//@ts-ignore
const { city, region, country, loc, org, postal, timezone } = json;

if (!org) {
logger.info(`no org: ${json}`);
}
const asn = org.substring(0, org.indexOf(" "));
const provider = org.substring(org.indexOf(" ") + 1);
return {
city: city,
region: region,
country: country,
asn: asn,
provider: provider,
};
} catch (e) {
logger.info(`There was an error fetching location data....`);
logger.info(e);
return blank;
}
const asn = org.substring(0, org.indexOf(" "));
const provider = org.substring(org.indexOf(" ") + 1);
return {
city: city,
region: region,
country: country,
asn: asn,
provider: provider,
};
};

0 comments on commit 35de5f8

Please sign in to comment.