I have a server configured with Dokku in production that contains 1 worker running delayed_job to execute some codes in background, but when I make deploys, the code running with delayed job has a strange behavior and sometimes run my new code deployed and sometimes run my old code before deploy. It is as if there were two instances of the delayed job and at each moment one was executed.
Reading some posts here, i see that delayed job implements something like cache and it should be cleaned after and before deploy, but I did not find it as it does in dokku.
Does anyone know how to keep just the new version of the code running on the worker?
Dokku implements zero-downtime deploys. This means that it does not shut down old containers until checks pass - for web process types - or a period of time has passed - for all others.
This behavior may be disabled for a given process type by running the following:
# for all process types, this will result in downtime during deploys
# replace APP with your app name
dokku checks:disable APP
# for a given process type
# replace APP with your app name
# replace PROCESS_TYPE with the process type for which you'd like to disable it for
dokku checks:disable APP PROCESS_TYPE