From 4239346f4ae47cbd66c9d01056920d072ce132e0 Mon Sep 17 00:00:00 2001 From: Thayol Date: Fri, 11 Jun 2021 14:10:20 +0200 Subject: [PATCH] Match history expires --- async/match/index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/async/match/index.php b/async/match/index.php index 4384acd..784ee4b 100644 --- a/async/match/index.php +++ b/async/match/index.php @@ -16,6 +16,7 @@ $call_prefix = ""; $call_suffix = ""; $recent_count = 6; +$max_history_time_sec = 86400; $selected_match = false; @@ -69,6 +70,13 @@ else natsort($all_matches); $all_matches = array_reverse($all_matches); $recent_matches = array_slice($all_matches, 0, $recent_count); + foreach ($recent_matches as $recent_key => $recent_file) + { + if ((time() - filemtime($recent_file)) > $max_history_time_sec) + { + unset($recent_matches[$recent_key]); + } + } $link_to_file = false;