Skip to content

Commit 098908a

Browse files
committed
fetch the first page only
1 parent 78abf4b commit 098908a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

services/static-webserver/client/source/class/osparc/jobs/RunsTableModel.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ qx.Class.define("osparc.jobs.RunsTableModel", {
125125
}
126126
return promise
127127
.then(jobs => {
128+
console.log("Jobs fetched", jobs);
128129
const data = [];
129130
const jobsCols = osparc.jobs.RunsTable.COLS;
130131
jobs.forEach(job => {
@@ -143,11 +144,14 @@ qx.Class.define("osparc.jobs.RunsTableModel", {
143144

144145
// Divides the model row request into several server requests to comply with the number of rows server limit
145146
const reqLimit = lastRow - firstRow + 1; // Number of requested rows
146-
const nRequests = Math.ceil(reqLimit / this.self().SERVER_MAX_LIMIT);
147+
let nRequests = Math.ceil(reqLimit / this.self().SERVER_MAX_LIMIT);
147148
if (nRequests > 1) {
148149
const requests = [];
149150
for (let i=firstRow; i <= lastRow; i += this.self().SERVER_MAX_LIMIT) {
150-
requests.push(getFetchPromise(i, i > lastRow - this.self().SERVER_MAX_LIMIT + 1 ? reqLimit % this.self().SERVER_MAX_LIMIT : this.self().SERVER_MAX_LIMIT))
151+
// fetch the first page only
152+
if (i < 1) {
153+
requests.push(getFetchPromise(i, i > lastRow - this.self().SERVER_MAX_LIMIT + 1 ? reqLimit % this.self().SERVER_MAX_LIMIT : this.self().SERVER_MAX_LIMIT))
154+
}
151155
}
152156
Promise.all(requests)
153157
.then(responses => this._onRowDataLoaded(responses.flat()))

0 commit comments

Comments
 (0)