Zee Spencer (He/They) · @Zee
382 followers · 1056 posts · Server social.coop

If you're using to scale your / application horizontally *and* you're using a database-backed job queue (like ) it's not a bad idea to stick to the primary when pulling jobs:

```rb
namespace :jobs do
task stick_to_primary!: [:environment] do
if Delayed::Job.connection.respond_to?(:stick_to_primary!)
Delayed::Job.connection.stick_to_primary!
end
end
end

Rake::Task['jobs:work'].enhance([:stick_to_primary!])
```

#DelayedJob #rails #ruby #makara

Last updated 2 years ago