Trying out cookie system
This commit is contained in:
parent
cf795eb90e
commit
6346565a1c
|
@ -176,5 +176,5 @@ async function csetforetell_inner(cookie){
|
||||||
|
|
||||||
export async function csetforetell(){
|
export async function csetforetell(){
|
||||||
let cookie = process.env.CSETFORETELL_COOKIE || getCookie("csetforetell")
|
let cookie = process.env.CSETFORETELL_COOKIE || getCookie("csetforetell")
|
||||||
await applyIfCookieExists(csetforetell_inner, cookie)
|
await applyIfCookieExists(cookie, csetforetell_inner)
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,7 +180,7 @@ async function goodjudgmentopen_inner(cookie) {
|
||||||
console.log(`Took ${difference / 1000} seconds, or ${difference / (1000 * 60)} minutes.`)
|
console.log(`Took ${difference / 1000} seconds, or ${difference / (1000 * 60)} minutes.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function goodjudmentopen(){
|
export async function goodjudgmentopen(){
|
||||||
let cookie = process.env.GOODJUDGMENTOPENCOOKIE || getCookie("goodjudgmentopen")
|
let cookie = process.env.GOODJUDGMENTOPENCOOKIE || getCookie("goodjudmentopen")
|
||||||
await applyIfCookieExists(goodjudgmentopen_inner, cookie)
|
await applyIfCookieExists(cookie, goodjudgmentopen_inner)
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,5 +220,5 @@ async function hypermind_inner(cookie) {
|
||||||
|
|
||||||
export async function hypermind() {
|
export async function hypermind() {
|
||||||
let cookie = process.env.HYPERMINDCOOKIE || getCookie("hypermind")
|
let cookie = process.env.HYPERMINDCOOKIE || getCookie("hypermind")
|
||||||
await applyIfCookieExists(hypermind_inner, cookie)
|
await applyIfCookieExists(cookie, hypermind_inner)
|
||||||
}
|
}
|
|
@ -2,7 +2,9 @@ import { writeFileSync } from "fs"
|
||||||
import { mongoReadWithReadCredentials, upsert } from "./mongo-wrapper.js"
|
import { mongoReadWithReadCredentials, upsert } from "./mongo-wrapper.js"
|
||||||
let mongoRead = mongoReadWithReadCredentials
|
let mongoRead = mongoReadWithReadCredentials
|
||||||
let isEmptyArray = arr => arr.length == 0
|
let isEmptyArray = arr => arr.length == 0
|
||||||
|
|
||||||
export async function addToHistory(){
|
export async function addToHistory(){
|
||||||
|
// throw new Error("Not today")
|
||||||
let currentJSON = await mongoRead("metaforecasts")
|
let currentJSON = await mongoRead("metaforecasts")
|
||||||
// console.log(currentJSON)
|
// console.log(currentJSON)
|
||||||
let historyJSON = await mongoRead("metaforecast_history")
|
let historyJSON = await mongoRead("metaforecast_history")
|
||||||
|
|
|
@ -10,5 +10,5 @@ export async function rebuildNetlifySiteWithNewData_inner(cookie){
|
||||||
|
|
||||||
export async function rebuildNetlifySiteWithNewData(){
|
export async function rebuildNetlifySiteWithNewData(){
|
||||||
let cookie = process.env.REBUIDNETLIFYHOOKURL || getCookie("netlify");
|
let cookie = process.env.REBUIDNETLIFYHOOKURL || getCookie("netlify");
|
||||||
await applyIfCookieExists(rebuildNetlifySiteWithNewData_inner, cookie)
|
await applyIfCookieExists(cookie, rebuildNetlifySiteWithNewData_inner)
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user