Skip to content

Commit

Permalink
fix: Disable keepalive for requests to GraphDB (#833)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer committed Nov 20, 2023
1 parent 9a27776 commit 8610caf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jest.config.js
Expand Up @@ -10,8 +10,8 @@ export default {
coverageReporters: ['json-summary', 'text'],
coverageThreshold: {
global: {
lines: 71.77,
statements: 71.8,
lines: 71.6,
statements: 71.63,
branches: 63.3,
functions: 69.72,
},
Expand Down
3 changes: 3 additions & 0 deletions src/graphdb.ts
Expand Up @@ -12,6 +12,7 @@ import {
} from './registration.js';
import {DatasetStore, extractIris} from './dataset.js';
import {Rating, RatingStore} from './rate.js';
import http from 'node:http';

export type SparqlResult = {
results: {
Expand All @@ -32,6 +33,7 @@ export class GraphDbClient {
private token?: string;
private username?: string;
private password?: string;
private agent = new http.Agent({keepAlive: false});

constructor(private url: string, private repository: string) {
// Doesn't work with authentication: see https://github.com/Ontotext-AD/graphdb.js/issues/123
Expand Down Expand Up @@ -78,6 +80,7 @@ export class GraphDbClient {
const repositoryUrl =
this.url + '/repositories/' + this.repository + options.url;
const response = await fetch(repositoryUrl, {
agent: this.agent,
method: options.method,
headers: headers,
body: options.body,
Expand Down

0 comments on commit 8610caf

Please sign in to comment.