2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 03:26:45 +00:00

Prevent duplicate call to "frontend compile" (#9519)

- Reduces `invoke update` time significantly
This commit is contained in:
Oliver 2025-04-16 09:06:16 +10:00 committed by GitHub
parent 99955c56d8
commit 0f58b854fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -474,8 +474,7 @@ def remove_mfa(c, mail=''):
def static(c, frontend=False, clear=True, skip_plugins=False): def static(c, frontend=False, clear=True, skip_plugins=False):
"""Copies required static files to the STATIC_ROOT directory, as per Django requirements.""" """Copies required static files to the STATIC_ROOT directory, as per Django requirements."""
if frontend and node_available(): if frontend and node_available():
frontend_trans(c, extract=False) frontend_compile(c)
frontend_build(c)
info('Collecting static files...') info('Collecting static files...')
@ -507,9 +506,7 @@ def translate(c, ignore_static=False, no_frontend=False):
manage(c, 'compilemessages') manage(c, 'compilemessages')
if not no_frontend and node_available(): if not no_frontend and node_available():
frontend_install(c) frontend_compile(c)
frontend_trans(c)
frontend_build(c)
# Update static files # Update static files
if not ignore_static: if not ignore_static:
@ -686,7 +683,9 @@ def update(
frontend_download(c) frontend_download(c)
if not skip_static: if not skip_static:
static(c, frontend=not no_frontend) # Collect static files
# Note: frontend has already been compiled if required
static(c, frontend=False)
success('InvenTree update complete!') success('InvenTree update complete!')