Dateien nach "/" hochladen
This commit is contained in:
@@ -5,6 +5,17 @@ $db_file = __DIR__ . '/status.sqlite';
|
||||
$pdo = new PDO('sqlite:' . $db_file);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
// --- Manuelle Bereinigung per Frontend ---
|
||||
if (isset($_GET['action']) && $_GET['action'] === 'cleanup') {
|
||||
// FEHLER BEHOBEN: Es muss $pdo heißen, nicht $db!
|
||||
// Zeitabgleich gefixt: Wir nutzen datetime('now', '-2 minutes'), da der INSERT auch in UTC erfolgt.
|
||||
$pdo->exec("DELETE FROM nodes WHERE last_seen < datetime('now', '-1 days')");
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(["status" => "success"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Tabelle erstellen, falls nicht existent
|
||||
$pdo->exec("CREATE TABLE IF NOT EXISTS nodes (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
||||
Reference in New Issue
Block a user