Skip to content

Commit a8aacf8

Browse files
committed
Fixing sync execution
1 parent 65430d0 commit a8aacf8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/ogc/connection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class OgcConnection extends Connection {
4444
}
4545
return Boolean(spec && spec.ogcapi);
4646
});
47-
let requestBody = Migrate.executeSync(openEO);
47+
let requestBody = Migrate.executeSync(this.connection, openEO);
4848
let headers = {};
4949
if (mode === 'async') {
5050
headers.Prefer = 'respond-async';

src/ogc/migrate.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -161,20 +161,21 @@ class OgcMigrate {
161161
* Executes an OGC API process synchronously.
162162
*
163163
* @todo Check whether implementation still works
164+
* @param {Connection} connection
164165
* @param {object} requestBody
165166
* @returns {object}
166167
*/
167-
static executeSync(requestBody) {
168+
static executeSync(connection, requestBody) {
168169
const graph = Object.values(requestBody.process.process_graph);
169170
const valid = graph.every(node => {
170-
let spec = OgcMigrate.connection.processes.get(node.process_id);
171+
let spec = connection.processes.get(node.process_id);
171172
return Boolean(spec && (spec.ogcapi || spec.id === 'load_collection'));
172173
});
173174
if (!valid) {
174175
throw new Error('Process must consist only of OGC Processes and Collections');
175176
}
176177

177-
const parser = new PgParser(requestBody.process, OgcMigrate.connection.getBaseUrl());
178+
const parser = new PgParser(requestBody.process, connection.getBaseUrl());
178179
return parser.parse();
179180
}
180181

0 commit comments

Comments
 (0)