Lock collection navigation tree changes

This commit is contained in:
Jori Lallo
2017-12-09 15:04:55 -08:00
parent 7af2ff20a8
commit c5e2bb2432
2 changed files with 22 additions and 1 deletions

View File

@ -5,4 +5,7 @@ import redisLock from 'redis-lock';
const client = redis.createClient(process.env.REDIS_URL);
const lock = redisLock(client);
export { client, lock };
const asyncLock = (lockName: string) =>
new Promise(resolve => lock(lockName, unlock => resolve(unlock)));
export { client, asyncLock };