fix: Do not update database if signed out
This commit is contained in:
parent
d9390faeec
commit
4247af47c6
|
@ -108,8 +108,8 @@ async function fetchStats(questionUrl, cookie){
|
||||||
let description = descriptionprocessed8
|
let description = descriptionprocessed8
|
||||||
|
|
||||||
// Number of forecasts
|
// Number of forecasts
|
||||||
console.log(response)
|
//console.log(response)
|
||||||
console.log(response.split("prediction_sets_count":")[1])
|
//console.log(response.split("prediction_sets_count":")[1])
|
||||||
let numforecasts = response.split("prediction_sets_count":")[1].split(",")[0]
|
let numforecasts = response.split("prediction_sets_count":")[1].split(",")[0]
|
||||||
// console.log(numforecasts)
|
// console.log(numforecasts)
|
||||||
|
|
||||||
|
@ -224,7 +224,11 @@ async function csetforetell_inner(cookie){
|
||||||
// let string = JSON.stringify(results,null, 2)
|
// let string = JSON.stringify(results,null, 2)
|
||||||
// fs.writeFileSync('./data/csetforetell-questions.json', string);
|
// fs.writeFileSync('./data/csetforetell-questions.json', string);
|
||||||
// console.log(results)
|
// console.log(results)
|
||||||
|
if(results.length > 0){
|
||||||
await upsert(results, "csetforetell-questions")
|
await upsert(results, "csetforetell-questions")
|
||||||
|
}else{
|
||||||
|
console.log("Not updating results, as process was not signed in")
|
||||||
|
}
|
||||||
|
|
||||||
let end = Date.now()
|
let end = Date.now()
|
||||||
let difference = end-init
|
let difference = end-init
|
||||||
|
|
|
@ -188,7 +188,12 @@ async function goodjudgmentopen_inner(cookie) {
|
||||||
}
|
}
|
||||||
// let string = JSON.stringify(results, null, 2)
|
// let string = JSON.stringify(results, null, 2)
|
||||||
// fs.writeFileSync('./data/goodjudmentopen-questions.json', string);
|
// fs.writeFileSync('./data/goodjudmentopen-questions.json', string);
|
||||||
|
|
||||||
|
if(results.length > 0){
|
||||||
await upsert(results, "goodjudmentopen-questions")
|
await upsert(results, "goodjudmentopen-questions")
|
||||||
|
}else{
|
||||||
|
console.log("Not updating results, as process was not signed in")
|
||||||
|
}
|
||||||
|
|
||||||
let end = Date.now()
|
let end = Date.now()
|
||||||
let difference = end - init
|
let difference = end - init
|
||||||
|
|
Loading…
Reference in New Issue
Block a user