Message from JavaScript discussions
February 2018
— If you trigger from API, you can just spin up HTTP from node
Four hourly triggers, you can use cron / Task Scheduler in your system, OR you can keep node running and use npmjs.org/cron
— For the cron system I already choose for npmjs.org/cron
— Ahh, alright
— So basic structure:
mainProcedure() {
setSomeRedisKeys(getDataFromMongo())
cleanVarnishCache()
}
api.on('trigger', mainProcedure)
cron(mainProcedure)
—
getData()
.then(reduceData)
.then(writeDatatoRedis)
Might be the preferred way
— Separating each process so you can switch mongo or redis independently
— Any external thing is a dependency, so they should be decoupled
— While the reducing operation shouldn't know about either mongo nor redis
— Hey guys, do you know where or have a function which removes one structure from another? Some kind of Object1 - Object2 = reduced Object1
— Http://ramdajs.com/docs/#omit
— Depends a bit on what you mean by subtract