Last active
April 19, 2025 00:59
-
-
Save cconstab/d80678289e23483ad25324f169c0eaf9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
try { | |
await atClient.put( | |
mutexKey, | |
'lock', | |
putRequestOptions: pro, | |
); | |
logger.shout('😎 Will handle request from ${notification.from}' | |
'; acquired mutex $mutexKey'); | |
} catch (err) { | |
if (err.toString().toLowerCase().contains('immutable')) { | |
logger.shout('🤷♂️ Will not handle request from ${notification.from}' | |
'; did not acquire mutex $mutexKey'); | |
return; | |
} else { | |
logger.shout('Will not handle; did not acquire mutex $mutexKey : $err'); | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment