File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -174,8 +174,11 @@ export const getBotFetch = async () => {
174174/**
175175 * Fetch RDF document with notification bot identity, and return quads
176176 */
177- export const fetchRdf = async ( uri : string ) => {
178- const authBotFetch = await getBotFetch ( )
177+ export const fetchRdf = async (
178+ uri : string ,
179+ authFetch ?: typeof globalThis . fetch ,
180+ ) => {
181+ const authBotFetch = authFetch ?? ( await getBotFetch ( ) )
179182 const { data : quads } = await fetchRdfDocument ( uri , authBotFetch )
180183 return quads
181184}
@@ -186,11 +189,13 @@ export const fetchRdf = async (uri: string) => {
186189const run = async ( qas : QueryAndStore ) => {
187190 let missingResources = qas . getMissingResources ( )
188191
192+ const authFetch = await getBotFetch ( )
193+
189194 while ( missingResources . length > 0 ) {
190195 let quads : Quad [ ] = [ ]
191196 const res = missingResources [ 0 ]
192197 try {
193- quads = await fetchRdf ( missingResources [ 0 ] )
198+ quads = await fetchRdf ( missingResources [ 0 ] , authFetch )
194199 } catch ( e ) {
195200 // eslint-disable-next-line no-console
196201 console . error ( e )
You can’t perform that action at this time.
0 commit comments