Skip to content

Does restoring cached outputs first delete the existing files? #546

Answered by milesj
bryanjswift asked this question in Q&A
Discussion options

You must be logged in to vote

@bryanjswift Great question.

If no outputs is defined, then no hydration occurs, and the state of the project folder just stays as-is.

If there are outputs, then we create the tarballs in .moon/cache/outputs. When a task is ran, we generate a hash, and if there's already an existing output with that hash, then we hydrate it. Hydration basically follows these steps:

  • For each file in the tarball, unpack it to the output destination if its a new file or the file contents are different than an existing file. We check file size and the contents.
  • For files that were already in the output destination, and not in the tarball, we assume these are stale files from a previous build, and we delete t…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@bryanjswift
Comment options

@bryanjswift
Comment options

@milesj
Comment options

@bryanjswift
Comment options

@milesj
Comment options

Answer selected by bryanjswift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants