Skip to content

Multi-execs from concurrent users not working #25

@smartinio

Description

@smartinio

The following code snippet works towards actual Upstash but not towards serverless-redis-http

Repro

import { Redis } from '@upstash/redis'

const redis = Redis.fromEnv()

await Promise.all(['a', 'b', 'c'].map(async (key) => {
  const multi = redis.multi()
  multi.set(key, 'foo')
  await multi.exec()
}))

console.log(await redis.mget('a', 'b', 'c'))

Expected

[ "foo", "foo", "foo" ]

Observed

UpstashError: ERR MULTI calls can not be nested, command was: [["set","b","foo"]]
      at new u (/Users/sam/redis-http-repro/node_modules/@upstash/redis/chunk-DKKYFKP2.mjs:1:42)
      at /Users/sam/redis-http-repro/node_modules/@upstash/redis/chunk-DKKYFKP2.mjs:1:1597

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions