Skip to content

Commit

Permalink
fix: Disable keepalive for requests to GraphDB
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer committed Nov 20, 2023
1 parent 9a27776 commit d7e6c92
Showing 1 changed file with 3 additions and 0 deletions.
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 d7e6c92

Please sign in to comment.