-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[14.0][ADD] web_assets_warmup #2614
Conversation
8300873
to
195807a
Compare
FTR I'm not sure if the name is really explicative. Something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we could have dedicated services for web and cronjobs. We should add a lock. Otherwise we can get a "serialize access" error.
+1 for web_assets_warmup |
web_generate_assets_initially ? |
asset "cache warmup" is really the technical term web developers would expect in a web framework IMHO. See for instance https://www.google.com/search?client=ubuntu-chr&hs=mW0&sca_esv=573172220&q=web+asset+cache+%22warmup%22+rails&oq=web+asset+cache+%22warmup%22+rails&aqs=heirloom-srp.. |
@bofiltd putting a lot of reviews in few minutes in the corresponding PRs is not trustful and can't be taken as a serious review, so please abstain for doing that. |
241fcad
to
e616356
Compare
With dedicated services for odoo web and odoo cron we can get a serialize access error on startup
e616356
to
12ff724
Compare
Module renamed to web_assets_warmup |
"""Plan the next execution of the cron responsible to generate assets.""" | ||
if os.environ.get("RUNNING_ENV") == "dev": | ||
return | ||
dbname = os.environ.get("DB_NAME") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DB_NAME
is not a core odoo var. The db name should be take from config.
Not blocking, you can fix this later as this one is waiting since quite some time.
/ocabot merge nobump |
On my way to merge this fine PR! |
Congratulations, your PR was merged at f10d729. Thanks a lot for contributing to OCA. ❤️ |
Ensure that assets are generated and stored in the DB when Odoo starts
If the assets from the database are not up-to-date, they are regenerated by
Odoo when we print a report, but to do so Odoo forces the commit, so if an
exception occurs after (or during) the report rendering, it let the database in
a broken state (picking have been validated in this case).
To prevent this issue, we need to ensure that the assets are well-generated
when Odoo starts, not when the report is printed.
cc @sebalix @mt-software-de