This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am murjam on github. | |
* I am mikk (https://keybase.io/mikk) on keybase. | |
* I have a public key ASAxdb2bAh9B3dmxiA9Vftj-n_Ger0-psC8Ii80hOvAbGQo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates a promise that resolves to either null when no lock was acquired or to user ID if lock was successful | |
* @param userId | |
* @returns {Function} async function (promise) | |
*/ | |
const getLockPromise = (userId) => { | |
const lockKey = `send-notifications-lock:${userId}`; | |
return async () => { | |
try { |