From 003ca6a555aff0904c403bc82a248177af6e5a93 Mon Sep 17 00:00:00 2001 From: David de Boer Date: Thu, 11 Jul 2024 19:28:27 +0200 Subject: [PATCH] fix: Increase number of retries --- src/import.ts | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/import.ts b/src/import.ts index f9e0305..b5aee60 100644 --- a/src/import.ts +++ b/src/import.ts @@ -40,28 +40,26 @@ export class Importer extends EventEmitter { } /** - * Wait for data to be available in the SPARQL store + * Wait for data to be available in the SPARQL store. */ private async dataLoaded() { + const query = `SELECT * FROM <${this.graph.value}> WHERE { ?s ?p ?o } LIMIT 1`; await pRetry( async () => { - const result = await this.queryEngine.queryBindings( - `SELECT * FROM <${this.graph.value}> WHERE { ?s ?p ?o } LIMIT 1`, - { - sources: [ - { - type: 'sparql', - value: this.store.options.queryUrl.toString(), - }, - ], - } - ); + const result = await this.queryEngine.queryBindings(query, { + sources: [ + { + type: 'sparql', + value: this.store.options.queryUrl.toString(), + }, + ], + }); const results = await result.toArray(); if (results.length === 0) { - throw new Error('No data loaded'); + throw new Error(`No data loaded (based on query ${query})`); } }, - {retries: 3} + {retries: 5} ); }