Closed jamesvillarrubia closed 5 years ago
Submitting GET request to /cache/clear
/cache/clear
Cache Clears
Response is correct, but when monitoring the CLI, a redis error is thrown:
{ ReplyError: ERR unknown command `flushall`, with args beginning with: at new Command ... command: 'FLUSHALL', code: 'ERR' }
Utilize the new FlushAll Async construction:
router.get('/clear', (req, res) => { client.flushall() res.status(HTTP_OK).json({ message: 'Cache cleared', status: HTTP_OK }); }); // clear a unique route
becomes
router.get('/clear', (req, res) => { client.flushall('ASYNC', () => { res.status(HTTP_OK).json({ message: 'Cache cleared', status: HTTP_OK }); }); });
Steps to reproduce
Submitting GET request to
/cache/clear
Expected behavior
Cache Clears
Actual behavior
Response is correct, but when monitoring the CLI, a redis error is thrown:
Proposed solution
Utilize the new FlushAll Async construction:
becomes