🛠Maintenance refactor
Some checks are pending
docker / docker_dev (push) Waiting to run

This commit is contained in:
jokob-sk
2024-06-29 14:39:12 +10:00
parent 709408ca2a
commit 08b163ebe4
26 changed files with 370 additions and 232 deletions

View File

@@ -28,10 +28,7 @@ if(array_key_exists('settings', $_REQUEST) != FALSE)
// call functions based on requested params
switch ($FUNCTION) {
case 'restartBackend':
restartBackend();
break;
case 'savesettings':
saveSettings();
@@ -228,6 +225,7 @@ function displayMessage($message, $logAlert = FALSE, $logConsole = TRUE, $logFil
}
// ----------------------------------------------------------------------------------------
// Adds an action to perform into the execution_queue.log file
function addToExecutionQueue($action)
{
@@ -247,27 +245,6 @@ function addToExecutionQueue($action)
}
// ----------------------------------------------------------------------------------------
function restartBackend()
{
$command = 'pkill -f "python /app/server" && (python /app/server > /dev/null 2>&1 &) && echo "done" 2>&1';
// Execute the command
$output = [];
$output_str = "";
$return_var = 0;
exec($command, $output, $return_var);
// Format the output
foreach ($output as $line) {
$output_str .= $line . "\n";
}
echo "Command result: $return_var, $output_str";
}
// ----------------------------------------------------------------------------------------
function cleanLog($logFile)