Skip to content

feat: support cache maintenance mode driver - #1481

Merged
hwbrzzl merged 3 commits into
masterfrom
optimize-pr-1198-maintenance-mode
Jun 9, 2026
Merged

hwbrzzl merged 3 commits into
masterfrom
optimize-pr-1198-maintenance-mode

Conversation

@goravel-coder

Copy link
Copy Markdown
Contributor

Summary

  • Allows maintenance mode state to be stored in a shared cache store for multi-server deployments.
  • Keeps file-backed maintenance mode as the default behavior.
  • Resolves maintenance middleware dependencies from the HTTP application container instead of global storage/hash facades.

Why

PR #1198 introduced file-backed up/down maintenance mode, which requires running the command on each server. A cache-backed driver lets applications share the same maintenance payload through an existing cache store while preserving the current file behavior by default.

APP_MAINTENANCE_DRIVER=cache
APP_MAINTENANCE_STORE=redis

With this configuration, running go run . artisan down or go run . artisan up on one server updates the maintenance state for every server using that cache store. The middleware now resolves storage, cache, config, and hash through http.App.Make*() like the other HTTP middleware, which makes it consistent with container-backed dependencies and easier to test.

@goravel-coder
goravel-coder requested a review from a team as a code owner June 9, 2026 07:21
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 59.50413% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.39%. Comparing base (e05b540) to head (2a02895).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
foundation/console/maintenance.go 51.85% 25 Missing and 14 partials ⚠️
foundation/application.go 0.00% 4 Missing ⚠️
http/middleware/check_for_maintenance_mode.go 83.33% 1 Missing and 2 partials ⚠️
foundation/console/up_command.go 75.00% 1 Missing and 1 partial ⚠️
foundation/console/down_command.go 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1481      +/-   ##
==========================================
- Coverage   69.42%   69.39%   -0.04%     
==========================================
  Files         376      377       +1     
  Lines       29902    30190     +288     
==========================================
+ Hits        20760    20950     +190     
- Misses       8182     8258      +76     
- Partials      960      982      +22     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@goravel-coder goravel-coder left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the maintenance cache driver change and found one concurrency issue to fix.

Comment thread foundation/console/maintenance.go
Comment thread http/middleware/check_for_maintenance_mode.go Outdated
Comment thread foundation/console/maintenance.go
@hwbrzzl
hwbrzzl merged commit 9e0d1e9 into master Jun 9, 2026
17 of 19 checks passed
@hwbrzzl
hwbrzzl deleted the optimize-pr-1198-maintenance-mode branch June 9, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants