Skip to content

Commit

Permalink
remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruv Chauhan authored and Dhruv Chauhan committed Oct 16, 2023
1 parent aa3b6c6 commit 5658276
Showing 1 changed file with 0 additions and 78 deletions.
78 changes: 0 additions & 78 deletions monitor/indexingStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,81 +264,3 @@ export async function indexStatusFlow(data, deployments) {
errorNotification("ERROR LOCATION 2 " + err.message);
}
}

export async function getIndexingStatusData(indexingStatusQueriesArray) {
try {
const indexingStatusQueries = indexingStatusQueriesArray.map((query) => {
return axios.post("https://api.thegraph.com/index-node/graphql", {
query: query,
});
});
let indexData = [];
await Promise.all(indexingStatusQueries)
.then((response) => {
return (indexData = response.map((resultData) => {
return resultData.data.data;
}));
})
.catch((err) => {
errorNotification("ERROR LOCATION 3 " + err);
});

let dataObjectToReturn = {};
indexData.forEach((dataset) => {
dataObjectToReturn = { ...dataObjectToReturn, ...dataset };
});
return dataObjectToReturn;
} catch (err) {
errorNotification("ERROR LOCATION 4 " + err.message);
}
}

export async function generateIndexStatusQuery(deployments) {
const fullCurrentQueryArray = ["query Status {"];
const fullPendingQueryArray = ["query Status {"];

try {
Object.keys(deployments).forEach((name) => {
fullCurrentQueryArray[fullCurrentQueryArray.length - 1] += `
${name
.split("-")
.join(
"_"
)}: indexingStatusForCurrentVersion(subgraphName: "messari/${name}") {
${queryContents}
}
`;
fullPendingQueryArray[fullPendingQueryArray.length - 1] += `
${name
.split("-")
.join(
"_"
)}_pending: indexingStatusForPendingVersion(subgraphName: "messari/${name}") {
${queryContents}
}
`;
if (
fullCurrentQueryArray[fullCurrentQueryArray.length - 1].length > 80000
) {
fullCurrentQueryArray[fullCurrentQueryArray.length - 1] += "}";
fullCurrentQueryArray.push(" query Status {");
}
if (
fullPendingQueryArray[fullPendingQueryArray.length - 1].length > 80000
) {
fullPendingQueryArray[fullPendingQueryArray.length - 1] += "}";
fullPendingQueryArray.push(" query Status {");
}
});
fullCurrentQueryArray[fullCurrentQueryArray.length - 1] += "}";
fullPendingQueryArray[fullPendingQueryArray.length - 1] += "}";

const indexingStatusQueries = [
...fullCurrentQueryArray,
...fullPendingQueryArray,
];
return indexingStatusQueries;
} catch (err) {
errorNotification("ERROR LOCATION 5 " + err.message);
}
}

0 comments on commit 5658276

Please sign in to comment.