From 094d218fe9f4b4e0113d8e6f9145b02a4ea2d1ee Mon Sep 17 00:00:00 2001 From: andreachild Date: Wed, 20 Nov 2024 09:25:05 -0800 Subject: [PATCH] Changed the retrieval of neptune graph summary to use http summary endpoint instead of GetGraphSummaryCommand as the GetGraphSummaryCommand will sometimes hang (#38) --- src/NeptuneSchema.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/NeptuneSchema.js b/src/NeptuneSchema.js index 1e79dbd..5d19cb6 100644 --- a/src/NeptuneSchema.js +++ b/src/NeptuneSchema.js @@ -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'; @@ -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; } /**