Skip to content

Fix/session store cleanup interval#1

Open
jee7s wants to merge 10 commits into
mainfrom
fix/session-store-cleanup-interval
Open

Fix/session store cleanup interval#1
jee7s wants to merge 10 commits into
mainfrom
fix/session-store-cleanup-interval

Conversation

@jee7s

@jee7s jee7s commented Apr 8, 2026

Copy link
Copy Markdown

No description provided.

jee7s and others added 10 commits April 7, 2026 22:47
connect-session-knex defaults to running a DELETE on expired sessions
every 60 seconds. Set clearInterval to 3600000ms to reduce DB churn.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Expose DB connection pool minimum and session store cleanup interval
as configurable options under the db: config block. Defaults are
min=2 and sessionCleanupInterval=86400000 (1 day).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Keeps the data.yml default at the original connect-session-knex value.
Users can override to a longer interval (e.g. 86400000) in config.yml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…container config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Caches the DB health check result and re-queries at most once per
interval (default 4 hours) to avoid keeping the connection alive.
Configurable via db.healthCheckInterval in config.yml or
DB_HEALTH_CHECK_INTERVAL env var in containers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move /healthz before Passport middleware so healthchecks don't trigger deserializeUser
- Cache deserialized users in memory (default 4h, configurable via auth.userCacheTTL / AUTH_USER_CACHE_TTL)
- Increase analytics cache TTL default to 1 day (configurable via analytics.cacheTTL / ANALYTICS_CACHE_TTL)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…are dependency

Moving all of ctrl.common early caused req.i18n to be undefined for page
routes since localization middleware hadn't run yet. Now only /healthz
is registered early; ctrl.common remains in its original position.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nup default

- The 4h deserializeUser cache had no invalidation path: flush it in
  reloadGroups (covers group/permission edits incl. the cross-instance
  event) and drop the entry on user update/delete/deactivate — permission
  revocations apply immediately again.
- /healthz is the ALB + ECS health check: only cache success for the full
  healthCheckInterval; a failed probe re-checks after 60s instead of
  pinning 503 for 4h and cycling healthy tasks.
- Ship the documented sessionCleanupInterval default (86400000): the
  60000 default ran a DELETE every minute, which keeps Aurora from ever
  idling — the exact cost this PR exists to eliminate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant