make MutexOptions optional

This commit is contained in:
HorizonCode 2025-01-10 01:20:11 +01:00
parent 33a49cba4a
commit 20496cc24b

View File

@ -16,7 +16,7 @@ export class MutexLock {
this.redisClient = redisClient; this.redisClient = redisClient;
} }
static async create(options: MutexOptions) { static async create(options?: MutexOptions) {
const redisClient = await redis const redisClient = await redis
.createClient({ .createClient({
url: `redis://${options?.redis?.host ?? "127.0.0.1"}:${options?.redis?.port ?? 6379}`, url: `redis://${options?.redis?.host ?? "127.0.0.1"}:${options?.redis?.port ?? 6379}`,