Skip to content

Commit

Permalink
Changed the retrieval of neptune graph summary to use http summary en…
Browse files Browse the repository at this point in the history
…dpoint instead of GetGraphSummaryCommand as the GetGraphSummaryCommand will sometimes hang (#38)
  • Loading branch information
andreachild authored Nov 20, 2024
1 parent 2d6c08c commit 0c17d87
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/NeptuneSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { aws4Interceptor } from "aws4-axios";
import { fromNodeProviderChain } from "@aws-sdk/credential-providers";
import { NeptunedataClient, ExecuteOpenCypherQueryCommand } from "@aws-sdk/client-neptunedata";
import { loggerDebug, loggerError, loggerInfo, yellow } from "./logger.js";
import { ExecuteQueryCommand, GetGraphSummaryCommand, NeptuneGraphClient } from "@aws-sdk/client-neptune-graph";
import { ExecuteQueryCommand, NeptuneGraphClient } from "@aws-sdk/client-neptune-graph";

const NEPTUNE_DB = 'neptune-db';
const NEPTUNE_GRAPH = 'neptune-graph';
Expand Down Expand Up @@ -366,14 +366,13 @@ function getNeptuneGraphClient() {
*/
async function getNeptuneGraphSummary() {
loggerInfo('Retrieving ' + NEPTUNE_GRAPH + ' summary')
const client = getNeptuneGraphClient();
const command = new GetGraphSummaryCommand({
graphIdentifier: NAME,
mode: 'detailed'
let response = await axios.get(`https://${HOST}:${PORT}/summary`, {
params: {
mode: 'detailed'
}
});
const response = await client.send(command);
loggerInfo('Retrieved ' + NEPTUNE_GRAPH + ' summary')
return response.graphSummary;
return response.data.graphSummary;
}

/**
Expand Down

0 comments on commit 0c17d87

Please sign in to comment.