Initial commit

This commit is contained in:
Luka Romih
2022-12-07 04:43:36 +01:00
commit 257f3c354f
496 changed files with 55373 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
const Redis = require('ioredis')
const debug = require('debug')('termPortal:models/cache')
const client = new Redis({ host: 'redis' })
client.on('error', debug)
const isReadyPromise = new Promise(resolve => client.on('ready', resolve))
client.waitForConnection = async () => {
// eslint-disable-next-line no-console
console.log('Waiting for cache to be ready')
await isReadyPromise
// eslint-disable-next-line no-console
console.log('Cache is ready')
}
module.exports = client