diff options
| author | Fuwn <[email protected]> | 2022-04-18 04:10:00 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-04-18 04:10:00 -0700 |
| commit | 7878dffa113e8051bdb229b04d33bcca74f21a7e (patch) | |
| tree | b322596a1ee621defe1cb83aee61c64c3fbad971 /src | |
| parent | feat: show preview for searches (diff) | |
| download | locus-7878dffa113e8051bdb229b04d33bcca74f21a7e.tar.xz locus-7878dffa113e8051bdb229b04d33bcca74f21a7e.zip | |
feat: cache more dynamic routes
Diffstat (limited to 'src')
| -rw-r--r-- | src/macros.rs | 6 | ||||
| -rw-r--r-- | src/main.rs | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/macros.rs b/src/macros.rs index f0e805f..bfaf9c2 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -18,7 +18,9 @@ #[macro_export] macro_rules! success { - ($body:expr, $context:ident) => { + ($body:expr, $context:ident) => {{ + $crate::route::cache(&$context, &$body); + Response::Success( Main { body: &$body, @@ -37,7 +39,7 @@ macro_rules! success { } .to_string(), ) - }; + }}; } #[macro_export] diff --git a/src/main.rs b/src/main.rs index 43b8448..d529f5c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -287,7 +287,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { format!( "# REMARKS\n\n{}", remarks - .into_iter() + .iter() .map(|r| format!("* {}", r)) .collect::<Vec<String>>() .join("\n") |