Skip to content
Open
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
10 changes: 9 additions & 1 deletion webpack_loader/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
'django_webpack_loader can\'t generate a nonce tag for a bundle, '
'because the passed request doesn\'t contain a "csp_nonce". '
'Chunk name: {chunk_name}')

_LOADER_POSSIBLE_LIMBO = (
'You are using django_webpack_loader with default timeout "None" '
'which can cause request to hang indefinitely. '
'Validate status of webpack-stats.json file if you experience infinite loading.'
)

@lru_cache(maxsize=100)
def _get_netloc(url: str) -> str:
Expand Down Expand Up @@ -187,6 +191,10 @@ def get_bundle(self, bundle_name):
time.sleep(self.config["POLL_INTERVAL"])
if timeout and (time.time() - timeout > start):
timed_out = True
if not timeout:
warn(
message=_LOADER_POSSIBLE_LIMBO, category=RuntimeWarning
)
assets = self.get_assets()

if timed_out:
Expand Down