Skip to content
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

eval eager_loading when ready #986

Merged
merged 3 commits into from
Oct 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to `dash` will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- [#986](https://github.com/plotly/dash/pull/986) Fix a bug with evaluation of `_force_eager_loading` when application is loaded with gunicorn

## [1.5.0] - 2019-10-29
### Added
- [#964](https://github.com/plotly/dash/pull/964) Adds support for preventing updates in clientside functions.
Expand Down
17 changes: 11 additions & 6 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,6 @@ def __init__(
plugins=None,
**obsolete
):
# Apply _force_eager_loading overrides from modules
for module_name in ComponentRegistry.registry:
module = sys.modules[module_name]
eager = getattr(module, '_force_eager_loading', False)
eager_loading = eager_loading or eager

for key in obsolete:
if key in ["components_cache_max_age", "static_folder"]:
raise exceptions.ObsoleteKwargException(
Expand Down Expand Up @@ -272,6 +266,7 @@ def __init__(
assets_external_path=get_combined_config(
"assets_external_path", assets_external_path, ""
),
eager_loading=eager_loading,
include_assets_files=get_combined_config(
"include_assets_files", include_assets_files, True
),
Expand Down Expand Up @@ -1434,6 +1429,16 @@ def _validate_layout(self):
component_ids.add(component_id)

def _setup_server(self):
# Apply _force_eager_loading overrides from modules
eager_loading = self.config.eager_loading
for module_name in ComponentRegistry.registry:
module = sys.modules[module_name]
eager = getattr(module, '_force_eager_loading', False)
eager_loading = eager_loading or eager

# Update eager_loading settings
self.scripts.config.eager_loading = eager_loading

if self.config.include_assets_files:
self._walk_assets_directory()

Expand Down