swarthy/redis-semaphore

View on GitHub
src/utils/index.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { RedisClient } from '../types'
import createEval from './createEval'

export { createEval }

export async function delay(ms: number) {
  return await new Promise(resolve => setTimeout(resolve, ms))
}

export function getConnectionName(client: RedisClient) {
  const connectionName = client.options?.connectionName
  return connectionName ? `<${connectionName}>` : '<unknown client>'
}