From 9855d44185ba9bc7b8eb2fe5566b0168a1fafd16 Mon Sep 17 00:00:00 2001 From: "Joseph.Rawlings" Date: Sun, 1 Mar 2026 05:10:47 -0500 Subject: [PATCH] fix: reorder gitpull.sh to restart PHP-FPM after cache clear PHP-FPM restart was happening before optimize:clear, so OPcache still held references to compiled views that were subsequently deleted. Move FPM restart to after cache clear + optimize, and remove the redundant CLI opcache_reset (doesn't affect FPM process). --- gitpull.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gitpull.sh b/gitpull.sh index f0f921388..2d80c8f16 100755 --- a/gitpull.sh +++ b/gitpull.sh @@ -14,12 +14,11 @@ OLD_HEAD=$(git rev-parse HEAD 2>/dev/null || echo "") STEPS=( "Pull latest code" "Maintenance mode" - "Restart PHP-FPM" "Clear caches" "Optimize app" "Set permissions" "Ensure queue running" - "Reset OPcache" + "Restart PHP-FPM" "Bring app online" "Check php-fpm" "Check paymenter" @@ -28,12 +27,11 @@ STEPS=( CMDS=( "git pull --rebase --autostash --quiet" "php artisan down --render='errors::503' --retry=60 --quiet || true" - "systemctl restart php8.3-fpm.service" "php artisan optimize:clear --quiet" "php artisan optimize --quiet" "find storage bootstrap/cache -not -perm 775 -type d -exec chmod 775 {} + -o -not -perm 664 -type f -exec chmod 664 {} +; chown -R www-data:www-data storage bootstrap/cache" "if ! pgrep -f 'artisan queue:work' >/dev/null; then nohup php artisan queue:work --daemon --quiet >> /dev/null 2>&1 & fi" - "php -r 'if(function_exists(\"opcache_reset\")) opcache_reset();' 2>/dev/null || true" + "systemctl restart php8.3-fpm.service" "php artisan up --quiet" "systemctl is-active --quiet php8.3-fpm || systemctl restart php8.3-fpm" "systemctl is-active --quiet paymenter.service || systemctl restart paymenter.service"