librariesio / libraries.io

:books: The Open Source Discovery Service
https://libraries.io
GNU Affero General Public License v3.0
1.11k stars 202 forks source link

Set a Default Unique Job Lock TTL and set some Specific Options on Maintenance Stat Worker #3299

Closed mikeyoung85 closed 8 months ago

mikeyoung85 commented 8 months ago

The big change here is setting a default TTL on Sidekiq Unique Job locks. The default is nil which means a lock will live f o r e v e r and if the lock fails to clear for some reason then the job is locked until redis crashes or somebody comes along and manually clears them. This sets the default to 1 day which seems mostly reasonable and can be overridden in specific workers if needed.

The other piece of the PR is setting a TTL and a custom prefix so I can try and hunt down locks for maintenance stats specifically in the future.