🔃 Sync Hub v0.7.2

This commit is contained in:
jokob-sk
2024-06-08 09:34:07 +10:00
parent f077c85c2d
commit 0d83ed3179
2 changed files with 14 additions and 9 deletions

View File

@@ -35,10 +35,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
// Generate a unique file path to avoid overwriting existing files
$files = glob("{$storage_path}/last_result.encoded.{$node_name}.*.log");
$files = glob("{$storage_path}/last_result.{encoded,decoded}.{$node_name}.*.log", GLOB_BRACE);
$file_count = count($files) + 1;
$file_path = "{$storage_path}/last_result.encoded.{$node_name}.{$file_count}.log";
// Save the decoded data to the file
file_put_contents($file_path, $data);
http_response_code(200);