Added more throtlling when fetching from metaculus
This commit is contained in:
parent
2ca3815de1
commit
ffbd09416d
|
@ -79,7 +79,7 @@ export async function metaculus() {
|
|||
(now < result.resolve_time)
|
||||
) {
|
||||
// console.log(result)
|
||||
await sleep(1000)
|
||||
await sleep(5000)
|
||||
let questionPage = await fetchMetaculusQuestionDescription(result.page_url)
|
||||
let descriptionraw = questionPage.split(`<div class="question__content">`)[1]
|
||||
let descriptionprocessed1 = descriptionraw.split("</div>")[0]
|
||||
|
|
|
@ -5,14 +5,12 @@ let sets = ["astralcodexten","coupcast", "csetforetell", "elicit", "estimize", "
|
|||
let suffix = "-questions"
|
||||
|
||||
export async function mergeEverything(){
|
||||
let merged = []
|
||||
for(let set of sets){
|
||||
let json = await mongoRead(set+suffix)
|
||||
merged = merged.concat(json)
|
||||
}
|
||||
let mergedprocessed = merged.map(element => ({...element, optionsstringforsearch: element.options.map(option => option.name).join(", ")}))
|
||||
await upsert( mergedprocessed,"metaforecasts")
|
||||
console.log("Done")
|
||||
let merged = []
|
||||
for(let set of sets){
|
||||
let json = await mongoRead(set+suffix)
|
||||
merged = merged.concat(json)
|
||||
}
|
||||
|
||||
|
||||
let mergedprocessed = merged.map(element => ({...element, optionsstringforsearch: element.options.map(option => option.name).join(", ")}))
|
||||
await upsert( mergedprocessed,"metaforecasts")
|
||||
console.log("Done")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user