<?php

require dirname(__FILE__) . "/bootstrap.php";

$response = [];

// Database
$pdo = PDOMysqlConnection::getInstance();

// Clean old records
$expire = time() - (60 * (getWebsiteConfig("view_counter_hysteresis") ?? 60));
$sql = "DELETE FROM station_view_count_tracker WHERE expire_timestamp < ?";
$stmt = $pdo->prepareAndExec($sql, [$expire]);
