Skip to content

Commit

Permalink
Tweak to remote file system caching for improved page loads (#435)
Browse files Browse the repository at this point in the history
* Revert 8aad9e1 -- slowed page loads down for attached files considerably

* Tweak pre-commit
  • Loading branch information
ml-evs authored Aug 16, 2023
1 parent 8d52337 commit 051735c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ repos:
- id: generate-schemas
name: Regenerate item model JSONSchemas
description: Check if the current code changes have enacted changes to the resulting JSONSchemas
entry: pipenv run invoke -r pydatalab dev.generate-schemas
entry: invoke -r pydatalab dev.generate-schemas
pass_filenames: false
language: python
5 changes: 4 additions & 1 deletion pydatalab/pydatalab/remote_filesystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ def get_directory_structure(
# then rebuild the cache.
if (
(not cached_dir_structure)
or cache_age > datetime.timedelta(minutes=CONFIG.REMOTE_CACHE_MAX_AGE)
or (
invalidate_cache is not False
and cache_age > datetime.timedelta(minutes=CONFIG.REMOTE_CACHE_MAX_AGE)
)
or (
invalidate_cache
and cache_age > datetime.timedelta(minutes=CONFIG.REMOTE_CACHE_MIN_AGE)
Expand Down

0 comments on commit 051735c

Please sign in to comment.