Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Skip redis and database connections during asset precompilation#5962

Open
cryptomilk wants to merge 1 commit intozammad:developfrom
cryptomilk:asn-assets-precompile
Open

Skip redis and database connections during asset precompilation#5962
cryptomilk wants to merge 1 commit intozammad:developfrom
cryptomilk:asn-assets-precompile

Conversation

@cryptomilk
Copy link

Asset precompilation only needs to compile CSS, JavaScript, and images. It does not require Redis (for ActionCable) or PostgreSQL/MySQL database connections. This patch modifies initializers to skip these services when running the assets:precompile rake task, allowing the build to succeed in environments where these services are not available.

I'm currently packaging zammad for openSUSE here. This is one of my patches trying to get it built.

@MrGeneration
Copy link
Member

Just out of interest, why are you building suse packages when there's already some from the vendor?

@cryptomilk
Copy link
Author

I prefer to use distribution packages instead of vendoring.

@mgruner
Copy link
Collaborator

mgruner commented Feb 24, 2026

This is a very interesting approach. We already had a similar use case in config/pre_initializers/load_asset_gems.rb, where we used a custom approach freezing the CLI arguments so that we can detect if assets:precompile is running. (This ArgvHelper is also used for other purposes in the task handling).

Your solution seems to be more elegant. Maybe it would be good to consider centralizing this logic, e.g. in Zammad::Application.is_assets_precompile_call? or similar?

@mantas FYI

@cryptomilk cryptomilk force-pushed the asn-assets-precompile branch from 5ac1112 to 4ff3dd5 Compare February 24, 2026 08:28
@cryptomilk
Copy link
Author

Your solution seems to be more elegant. Maybe it would be good to consider centralizing this logic, e.g. in Zammad::Application.is_assets_precompile_call? or similar?

Done.

Asset precompilation only needs to compile CSS, JavaScript, and images.
It does not require Redis (for ActionCable) or PostgreSQL/MySQL database
connections. This patch modifies initializers to skip these services
when running the assets:precompile rake task, allowing the build to
succeed in environments where these services are not available.
@cryptomilk cryptomilk force-pushed the asn-assets-precompile branch from 3f8e24a to cc9e9a3 Compare February 25, 2026 09:37
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.

4 participants