Trying out cookie system

This commit is contained in:
NunoSempere 2021-04-10 20:28:19 +02:00
parent cf795eb90e
commit 6346565a1c
5 changed files with 8 additions and 6 deletions

View File

@ -176,5 +176,5 @@ async function csetforetell_inner(cookie){
export async function csetforetell(){
let cookie = process.env.CSETFORETELL_COOKIE || getCookie("csetforetell")
await applyIfCookieExists(csetforetell_inner, cookie)
await applyIfCookieExists(cookie, csetforetell_inner)
}

View File

@ -180,7 +180,7 @@ async function goodjudgmentopen_inner(cookie) {
console.log(`Took ${difference / 1000} seconds, or ${difference / (1000 * 60)} minutes.`)
}
export async function goodjudmentopen(){
let cookie = process.env.GOODJUDGMENTOPENCOOKIE || getCookie("goodjudgmentopen")
await applyIfCookieExists(goodjudgmentopen_inner, cookie)
export async function goodjudgmentopen(){
let cookie = process.env.GOODJUDGMENTOPENCOOKIE || getCookie("goodjudmentopen")
await applyIfCookieExists(cookie, goodjudgmentopen_inner)
}

View File

@ -220,5 +220,5 @@ async function hypermind_inner(cookie) {
export async function hypermind() {
let cookie = process.env.HYPERMINDCOOKIE || getCookie("hypermind")
await applyIfCookieExists(hypermind_inner, cookie)
await applyIfCookieExists(cookie, hypermind_inner)
}

View File

@ -2,7 +2,9 @@ import { writeFileSync } from "fs"
import { mongoReadWithReadCredentials, upsert } from "./mongo-wrapper.js"
let mongoRead = mongoReadWithReadCredentials
let isEmptyArray = arr => arr.length == 0
export async function addToHistory(){
// throw new Error("Not today")
let currentJSON = await mongoRead("metaforecasts")
// console.log(currentJSON)
let historyJSON = await mongoRead("metaforecast_history")

View File

@ -10,5 +10,5 @@ export async function rebuildNetlifySiteWithNewData_inner(cookie){
export async function rebuildNetlifySiteWithNewData(){
let cookie = process.env.REBUIDNETLIFYHOOKURL || getCookie("netlify");
await applyIfCookieExists(rebuildNetlifySiteWithNewData_inner, cookie)
await applyIfCookieExists(cookie, rebuildNetlifySiteWithNewData_inner)
}