aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/macros.rs8
-rw-r--r--src/route.rs1
2 files changed, 4 insertions, 5 deletions
diff --git a/src/macros.rs b/src/macros.rs
index 8507d97..7d3868c 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -49,10 +49,10 @@ macro_rules! mount_page {
($router).mount(
$at,
Box::new(|context| {
- success!(
- include_str!(concat!("../content/pages/", $file, ".gmi")),
- context
- )
+ let content = include_str!(concat!("../content/pages/", $file, ".gmi"));
+
+ crate::route::cache(&context, &content);
+ success!(content, context)
}),
);
};
diff --git a/src/route.rs b/src/route.rs
index 2da2cbb..dce4145 100644
--- a/src/route.rs
+++ b/src/route.rs
@@ -57,7 +57,6 @@ pub fn track_mount(
router.mount(route, handler);
}
-#[allow(unused)]
pub fn cache(context: &windmark::returnable::RouteContext<'_>, response: &str) {
static LAST_CACHED: SyncLazy<Mutex<Instant>> =
SyncLazy::new(|| Mutex::new(Instant::now()));