diff --git a/package-lock.json b/package-lock.json index 35f0a54..195b0af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rdfc/sparql-ingest-processor-ts", - "version": "2.1.6", + "version": "2.1.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rdfc/sparql-ingest-processor-ts", - "version": "2.1.6", + "version": "2.1.7", "license": "MIT", "dependencies": { "@treecg/types": "^0.4.6", diff --git a/package.json b/package.json index 2df6c3a..83600ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rdfc/sparql-ingest-processor-ts", - "version": "2.1.6", + "version": "2.1.7", "description": "SPARQL Update function to be within RDF-Connect pipelines", "author": "Julián Rojas", "contributors": [ @@ -53,4 +53,4 @@ "vite-tsconfig-paths": "^6.1.1", "vitest": "^4.0.18" } -} \ No newline at end of file +} diff --git a/src/Utils.ts b/src/Utils.ts index 60e31c2..694bf07 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -168,6 +168,8 @@ export async function doSPARQLRequest( if (!res.ok) { throw new Error(`HTTP request failed with code ${res.status} and message: \n${await res.text()}`); } + // Consume the response body to prevent memory leaks + await res.text(); return; } @@ -199,6 +201,8 @@ export async function doSPARQLRequest( if (!res.ok) { throw new Error(`HTTP request failed with code ${res.status} and message: \n${await res.text()}`); } + // Consume the response body to prevent memory leaks + await res.text(); } } catch (err: unknown) { logger.error(`Error while executing SPARQL request: ${(err).message} - ${(err).cause}`);