|
let v = await this._cache.set(key, this._cacheSetTransform(value), { |
If you needed a really strong guarantee that the lock was in fact held while setting a redis cache value and the lock and cache redis servers were one and the same then you could use Lua to query the lock and set the cache value atomically.
I suppose at that point you may as well just store the lock and cache values under the same key
lock_and_cache_js/index.js
Line 366 in 05258a8
If you needed a really strong guarantee that the lock was in fact held while setting a redis cache value and the lock and cache redis servers were one and the same then you could use Lua to query the lock and set the cache value atomically.
I suppose at that point you may as well just store the lock and cache values under the same key