Skip to content

Commit 2eb8a62

Browse files
committed
Activity report tweaks
1 parent ee43835 commit 2eb8a62

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

‎vzdv-site/src/endpoints/admin.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,11 +1068,11 @@ async fn page_activity_report_generate(
10681068
}
10691069
let user_info = user_info.unwrap();
10701070

1071-
// cache this endpoint's returned data for 6 hours
1071+
// cache this endpoint's returned data for 3 hours
10721072
let cache_key = "ACTIVITY_REPORT".to_string();
10731073
if let Some(cached) = state.cache.get(&cache_key) {
10741074
let elapsed = Instant::now() - cached.inserted;
1075-
if elapsed.as_secs() < 60 * 60 * 6 {
1075+
if elapsed.as_secs() < 60 * 60 * 3 {
10761076
return Ok(Html(cached.data).into_response());
10771077
}
10781078
state.cache.invalidate(&cache_key);

‎vzdv-site/templates/admin/activity_report.jinja‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
<p>Months: {{ months }} </p>
44

5+
<p class="py-3">
6+
Generated at:{{ now_utc }} and cached for 3 hours afterwards
7+
<br>
8+
Click <a href="/admin/activity_report/delete" class="text-decoration-none">here</a> to clear that cache.
9+
</p>
10+
511
<h3>Rated controller violations</h3>
612
<table class="table table-striped table-hover">
713
<thead>
@@ -61,12 +67,6 @@
6167
<button class="btn btn-warning" role="button" id="btn-roster-remove">Remove marked controllers from roster</button>
6268
</div>
6369

64-
<p class="pt-3">
65-
Generated at: {{ now_utc }}; cached for 6 hours afterwards
66-
<br>
67-
Click <a href="/admin/activity_report/delete" class="text-decoration-none">here</a> to clear that cache.
68-
</p>
69-
7070
<script>
7171
document
7272
.getElementById("btn-roster-remove")

‎vzdv-site/templates/changelog.jinja‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414

1515
<hr>
1616

17+
<div class="card shadow mb-3">
18+
<div class="card-body">
19+
<h5 class="card-title">2026-04-01</h5>
20+
<div class="card-text">
21+
<ul>
22+
<li>Slight design changes to activity report page.</li>
23+
<li>Activity report now cached for 3 hours instead of 6.</li>
24+
</ul>
25+
</div>
26+
</div>
27+
</div>
28+
1729
<div class="card shadow mb-3">
1830
<div class="card-body">
1931
<h5 class="card-title">2026-03-11</h5>

0 commit comments

Comments
 (0)