Skip to content

client.multi() not working #10

@ghostdouble

Description

@ghostdouble

using the following, for example, does not work
await client.multi().set('a','b').exec()

temporary fix:

  1. in node_modules/redis-commands/commands.json, remove the multi key (or find a way to skip multi in async-redis decorate)
  2. use
const redis = require("redis")
const asyncRedis = require("async-redis")
const client = redis.createClient()
const asyncRedisClient = asyncRedis.decorate(client)
  1. use all commands the normal way, except for multi - wrap it in a promise
const res = await new Promise((resolve, reject)=>{
 multistack = asyncRedisClient.multi()
 multistack.set('a','b')
 multistack.hset('h','x','y')
 multistack.exec((err,results)=>{
  resolve(results)
 })
})

Metadata

Metadata

Assignees

Labels

Hack OctoberThings to fix in October

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions