Repository navigation
Replies: 2 comments 2 replies
|
Doesn’t look like a bug to me. Looking at recipe/deploy/release.php, previous_release is just releases_list[1], which is the release created before the current one. It doesn’t check where current points or the BAD_RELEASE/DIRTY_RELEASE markers, so after a rollback or a failed deploy it can point to a release that wasn’t actually live. If you need the release that was actually live, capture current before the symlink switch: before('deploy:symlink', function () {
if (test('[ -L {{current_path}} ]')) {
set('live_release_before', run('readlink -f {{current_path}}'));
}
});
after('deploy:symlink', function () {
// restart workers / compare with get('live_release_before') here
run('{{bin/php}} {{release_or_current_path}}/bin/console messenger:stop-workers');
});For restarting Messenger workers specifically you don’t even need the previous path: messenger:stop-workers after deploy:symlink is enough, and your supervisor will restart them from the new current. |
|
If this was thought through, when it was implemented, what is the intended behaviour? Because I can't imagine a case, where I want the previous_release instead of the "one which was last live". Beside that, I learned from AI, that stopping workers works through setting a cache key... which only works if I write it to the correct cache directory, aka the old one? So I'm currently not convinced, it is intended behaviour instead of "accidentally implemented like this without thinking it through" 🙈 |
Uh oh!
There was an error while loading. Please reload this page.
I'm currently working on shopware/symfony deployment. In which I want to restart the message queue workers once the symlink is changed.
previous_releasesounds like the correct variable, but it ignores rollbacks and aborted releases.Is this intended behaviour or a bug? If it is the last, I'm happy to fix it.
All reactions