tweak: console.log tweak

This commit is contained in:
NunoSempere 2022-10-28 13:59:14 +01:00
parent 1fa2aa1bdd
commit fd7839932d

View File

@ -83,7 +83,6 @@ const getAnswerProbability = (answer : any) => {
// Fetching // Fetching
async function fetchPage(bearer: string, pageNum: number) { async function fetchPage(bearer: string, pageNum: number) {
let pageUrl = `${marketsEnpoint}&page=${pageNum}` let pageUrl = `${marketsEnpoint}&page=${pageNum}`
console.log(`Fetching page #${pageNum}`) // : ${pageUrl}
const response = await axios({ const response = await axios({
url: pageUrl, // &orderBy=is_resolved&sortedBy=desc`, url: pageUrl, // &orderBy=is_resolved&sortedBy=desc`,
method: "GET", method: "GET",
@ -172,6 +171,9 @@ async function fetchAllMarkets(bearer: string) {
let categories = [] let categories = []
let isEnd = false let isEnd = false
while (! isEnd) { while (! isEnd) {
if(pageNum % 20 == 0){
console.log(`Fetching page #${pageNum}`) // : ${pageUrl}
}
let page = await fetchPage(bearer, pageNum) let page = await fetchPage(bearer, pageNum)
// console.log(JSON.stringify(page, null, 2)) // console.log(JSON.stringify(page, null, 2))
let data = page.data let data = page.data