Reduced pager to 5 pages at a time

This commit is contained in:
Nedim Uka
2019-07-08 13:02:28 +02:00
parent 2dd1eaa5fd
commit 1b098f181c

View File

@@ -134,7 +134,7 @@ class Indexer {
} else {
console.log("HAS MORE RESULTS, should only contain HREFS");
console.log(results.length);
const newResults = await this.indexWithPagination(results[0].pageNumber + 10);
const newResults = await this.indexWithPagination(results[0].pageNumber + 5);
const singlePageIndexers = this.prepareHrefIndexers(results);
const newerResults = await Promise.map(singlePageIndexers, function (indexer) {
@@ -161,7 +161,7 @@ class Indexer {
const indexers = [];
let lastPageNumber;
if (pageNr) {
for (let index = Number(pageNr[0]); index <= Number(pageNr[0]) + 10; index++) {
for (let index = Number(pageNr[0]); index <= Number(pageNr[0]) + 5; index++) {
lastPageNumber = index;
const newOlxUrl = {
url: this.olxUrl.url.replace(/\d+$/, "") + index,
@@ -172,7 +172,7 @@ class Indexer {
}
} else {
for (let index = 1; index <= 10; index++) {
for (let index = 1; index <= 5; index++) {
lastPageNumber = index;
const newOlxUrl = {
url: this.olxUrl.url + index,