Skip to content

Commit

Permalink
fix opcache reset
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-ivona committed Feb 14, 2024
1 parent 344a11e commit 9a870dd
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions app/Recipes/Laravel/Commands/Deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function handle(DockerService $docker_service, TerminalService $terminal)
}
}


if (!$this->task("Updating codebase from git", function () use ($docker_service, $terminal) {
$commands = [
'cd',
Expand All @@ -76,6 +75,21 @@ public function handle(DockerService $docker_service, TerminalService $terminal)
return false;
}

if(env('ENABLE_OPCACHE')){
if (!$this->task("Resetting OpCache", function () use ($docker_service, $terminal) {

$commands = [
'php',
"/usr/bin/cachetool.phar",
"opcache:reset",
];

return $docker_service->service('php')->execute($terminal, $commands);
})) {
return false;
}
}


if (!$this->task("Installing Composer packages", function () use ($docker_service, $terminal) {
if ($this->is_production()) {
Expand All @@ -96,20 +110,6 @@ public function handle(DockerService $docker_service, TerminalService $terminal)
return false;
}

if(env('ENABLE_OPCACHE')){
if (!$this->task("Resetting OpCache", function () use ($docker_service, $terminal) {

$commands = [
"/usr/bin/cachetool.phar",
"opcache:reset",
];

return $docker_service->service('php')->execute($terminal, $commands);
})) {
return false;
}
}

if (!$this->task("Database maintenance", function () use ($docker_service, $terminal) {
$docker_service->service('php')->execute($terminal, [
'php',
Expand Down

0 comments on commit 9a870dd

Please sign in to comment.