refactor: Simplify log drain installation and stop log drain if necessary

This commit is contained in:
Andras Bacsai
2024-08-06 10:52:47 +02:00
parent c5de1a25c3
commit 74e8a4a703
3 changed files with 25 additions and 6 deletions

View File

@@ -24,12 +24,7 @@ class InstallLogDrain
}
try {
if ($type === 'none') {
$command = [
"echo 'Stopping old Fluent Bit'",
'docker rm -f coolify-log-drain || true',
];
return instant_remote_process($command, $server);
return 'No log drain is enabled.';
} elseif ($type === 'newrelic') {
if (! $server->settings->is_logdrain_newrelic_enabled) {
throw new \Exception('New Relic log drain is not enabled.');