Skip to content

Incomplete cache should not interfere with re-running#340

Merged
j-atkins merged 16 commits into
mainfrom
passive-cache
May 20, 2026
Merged

Incomplete cache should not interfere with re-running#340
j-atkins merged 16 commits into
mainfrom
passive-cache

Conversation

@j-atkins
Copy link
Copy Markdown
Collaborator

This PR changes the cache logic so that a subsequent run is not met with an error/instruction to manually delete cache directory when a previous run was interrupted. This was an annoying feature previously. Now the id_latest will be updated to the latest timestamp because a cache from an interrupted/incomplete run is not useful.

  • New test added

Closes #304

@j-atkins j-atkins requested a review from erikvansebille May 19, 2026 13:27
Copy link
Copy Markdown
Member

@erikvansebille erikvansebille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One small comment below

Comment thread src/virtualship/cli/_run.py Outdated
Comment on lines +263 to +264
id_path = cache_dir / EXPEDITION_IDENTIFIER
last_expedition_path = cache_dir / EXPEDITION_LATEST
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason not to use joinpath here? That is more robust to backslashes-vs-forwardslashes confusion between linux and windows? That's relevant because we're not testing on Windows (or are we?)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do test on Windows, so yes, good idea to go for more robustness, will do.

@j-atkins j-atkins merged commit 0ba7dd5 into main May 20, 2026
11 checks passed
@j-atkins j-atkins deleted the passive-cache branch May 20, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid incomplete cache dir interfering with subsequent runs

2 participants