skip to Main Content

Use fastify-redis from controllers in node.js

How to use fastify-redis plugin from other controllers or other.js while declaring the redis connection in server.js server.js const fastify = require('fastify')({ logger: false }) const routes = require('./routes') fastify.register(require('fastify-redis'), { host: '127.0.0.1' }) routes.forEach((route, index) => { fastify.route(route) })…

VIEW QUESTION

Redis – Nodejs loop event execution

Hello I am having problems with my setInterval it is only executing only once the if else checks below is my function const redis = require('redis'); const cache = redis.createClient(); require('./execSocket'); function teste(){ cache.dbsize(function(err,res){ if(res){ console.log(res); if(res > 10){ require('./execSql');…

VIEW QUESTION
Back To Top
Search