π Smithery is now a part of Arcade.dev! Read more in our announcement here
Distributed cron jobs and locking patterns.
@Cron()
SET resource_name my_random_value NX PX 30000
Implementation:
@Cron(CronExpression.EVERY_MINUTE) @DistributedLock({ key: 'send_emails', ttl: 5000 }) async handleCron() { // Only runs if lock acquired }
Tools: Use nestjs-redlock or custom Redis wrapper via redlock library.
nestjs-redlock
redlock
try/catch