Skip to content

mode = force: only delete the existing cache after computation #118

Open

Description

@sdascoli

It often happens that we set mode=force to overwrite a cache, then forget to switch back just after, run the function and it deletes the cache we just took ages to populate. And now it's too late...
Would it be possible to delete the cache only after the computation (or simple overwrite it), so that when this happens we can just stop the accidentally started job without loosing anything?

Activity

  1. sdascoli commented on Oct 8, 2025

    @sdascoli
    ContributorAuthor

    (also, isn't "overwrite" a better name than "force"?)

  2. kingjr commented on Oct 9, 2025

    @kingjr
    Contributor

    It often happens that we set mode=force to overwrite a cache, then forget to switch back just after, run the function and it deletes the cache we just took ages to populate. And now it's too late...

    I also faced this issue.

    Quite hard to handle with the job / cache checking however, thoughts @jrapin ?

  3. jrapin commented on Oct 13, 2025

    @jrapin
    Contributor

    Could be nice indeed but I expect it's complex to implement, the current implementation is just a few lines deleting the cache once, and then running the regular code. Switching to deletion after computation implies many small changes in different parts of the pipeline.

    Also, while the current behavior is painful, I am a bit afraid of what would happen without it, if something bugs for part of the computation, you could end up with a mixture of old and new cache without noticing

  4. kingjr commented on Oct 13, 2025

    @kingjr
    Contributor

    Yes I would recommend to simply change the cache folder is these situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions