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

Php versions – Class 'Redis' not found in Lumen

Lumen Version: 6.0 PHP Version: 7.2 Database Driver & Version: MySql 5.7, Redis Code use IlluminateSupportFacadesRedis; Redis::set($key, $data, 'EX', $expiry); in app.php $app->withFacades(); $app->withEloquent(); $app->register(IlluminateRedisRedisServiceProvider::class); $app->configure('database'); Using the above code gives Class 'Redis' not found error. This error occurs only…

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