Skip to content

Commit 33ddd86

Browse files
committed
Revert "Prefetch sources (#184)"
This reverts commit 5828476.
1 parent b8c3af2 commit 33ddd86

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

src/ldf-client-ui.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ if (typeof global.process === 'undefined')
476476
})).trigger('chosen:updated');
477477
// Update the query set
478478
this._loadQueries(value);
479-
this._prefetchSources();
480479
break;
481480
// Set the query
482481
case 'query':
@@ -1072,21 +1071,6 @@ if (typeof global.process === 'undefined')
10721071
const $webid = $('.webid', this.element);
10731072
$webid.html(`Logged in as <a href="${this.$solidSession.info.webId}" target="_blank">${name || shortenUrl(this.$solidSession.info.webId, 35)}</\a>`);
10741073
},
1075-
1076-
_prefetchSources: function () {
1077-
if (!this._queryWorker || this.options.bypassCache)
1078-
return;
1079-
1080-
const datasources = Object.keys(this.options.selectedDatasources || {});
1081-
if (!datasources.length)
1082-
return;
1083-
1084-
this._queryWorker.postMessage({
1085-
type: 'prefetchSources',
1086-
sources: datasources.map(datasource => resolve(datasource, window.location.href)),
1087-
context: this._getQueryContext(),
1088-
});
1089-
},
10901074
};
10911075

10921076
// Creates a function that appends text to the given element in a throttled way

src/ldf-client-worker.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -138,24 +138,6 @@ SELECT ?name WHERE {
138138
}).catch(postError);
139139
}).catch(postError);
140140
},
141-
142-
prefetchSources: async function ({ sources, context }) {
143-
if (!sources || !sources.length)
144-
return;
145-
146-
initEngine({ context });
147-
context.log = logger;
148-
149-
await Promise.allSettled(
150-
sources.map(source =>
151-
engine.queryBoolean('ASK { ?s ?p ?o }', {
152-
...context,
153-
sources: [source],
154-
})
155-
)
156-
);
157-
},
158-
159141
};
160142

161143
function postError(error) {

0 commit comments

Comments
 (0)