Skip to content

Commit

Permalink
Do provide state in offline mode (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp authored Nov 20, 2024
1 parent ec595e3 commit c028503
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
11 changes: 8 additions & 3 deletions conda_libmamba_solver/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def _fetch_one_repodata_json(self, url: str) -> tuple[str, os.PathLike, Repodata
# This might not exist (yet, anymore), but that's ok because we'll check
# for existence later and safely ignore if needed
json_path = subdir_data.cache_path_json
state = None
state = subdir_data.repo_cache.load_state()
else:
# TODO: This method loads reads the whole JSON file (does not parse)
json_path, state = subdir_data.repo_fetch.fetch_latest_path()
Expand Down Expand Up @@ -396,11 +396,16 @@ def _load_repo_info_from_json_path(
path=str(solv_path),
expected=repodata_origin,
channel_id=channel_id,
add_pip_as_python_dependency=context.add_pip_as_python_dependency,
add_pip_as_python_dependency=PipAsPythonDependency(
context.add_pip_as_python_dependency
),
)
except Exception as exc:
log.debug("Failed to load from SOLV. Trying JSON at %s", json_path, exc_info=exc)
log.debug("Failed to load from SOLV. Trying JSON.", exc_info=exc)
try:
log.debug(
"Loading %s (%s) from JSON repodata at %s", channel_id, channel_url, json_path
)
repo = self.db.add_repo_from_repodata_json(
path=str(json_path),
url=channel_url,
Expand Down
19 changes: 19 additions & 0 deletions news/570-solv-slowdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Load SOLV repodata cache in offline mode too. (#570)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>

0 comments on commit c028503

Please sign in to comment.