summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKit La Touche <kit@transneptune.net>2024-10-31 22:59:51 -0400
committerKit La Touche <kit@transneptune.net>2024-10-31 22:59:51 -0400
commita32b0ab6ad7995b8fff98e423793a7c6521ea1e9 (patch)
tree9e0e7361d9b397ad92c9109523c072e2c5c66bba
parentea1631476af50f308652787e17678264d671ade3 (diff)
parent8088a8bd8bced9127edcb2284b993332d291b443 (diff)
Merge branch 'main' into wip/mobile
-rw-r--r--src/cli.rs15
-rw-r--r--ui/routes/+layout.svelte1
2 files changed, 11 insertions, 5 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 0659851..308294d 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -87,10 +87,6 @@ impl Args {
let app = App::from(pool);
let app = routers(&app)
- .route_layer(middleware::from_fn_with_state(
- app.clone(),
- expire::middleware,
- ))
.route_layer(middleware::from_fn(clock::middleware))
.route_layer(middleware::map_response(Self::server_info()))
.with_state(app);
@@ -144,6 +140,17 @@ fn routers(app: &App) -> Router<App> {
]
.into_iter()
.fold(Router::default(), Router::merge)
+ // Run expiry whenever someone accesses the API. This was previously a blanket middleware
+ // affecting the whole service, but loading the client makes a several requests before the
+ // client can completely load, each of which was triggering expiry. There is absolutely no
+ // upside to re-checking expiry tens of times back-to-back like that; the API is accessed
+ // more regularly and with less of a traffic rush.
+ //
+ // This should, probably, be moved to a background job at some point.
+ .route_layer(middleware::from_fn_with_state(
+ app.clone(),
+ expire::middleware,
+ ))
.route_layer(middleware::from_fn_with_state(app.clone(), setup_required)),
// API endpoints that handle setup
setup::router(),
diff --git a/ui/routes/+layout.svelte b/ui/routes/+layout.svelte
index fbc17ec..eb29179 100644
--- a/ui/routes/+layout.svelte
+++ b/ui/routes/+layout.svelte
@@ -43,7 +43,6 @@
<style>
#app {
margin: 0;
- padding: 0;
height: 100vh;
width: 100%;
}