Does restoring cached outputs first delete the existing files? #546
-
By way of context setting I'll describe what has led me to this question. I've been working on converting a large-ish monorepo to use moon rather than makefiles. I'm fairly near the end of the conversion and have started to test the developer experience locally. When developing locally there are typically three different HTTP based services running locally, each of the local HTTP servers have some hot reloading or restart on changes behavior. During my testing I have noticed that sometimes if I rebuild the project while the local HTTP server processes are running some cached files will be restored such that I only get about half of the file contents. A different local HTTP server process will die completely with a stack trace indicating it failed in the Basically, I don't have enough information to create a good bug report but want to understand the behavior of moon when restoring cached outputs a bit better. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
@bryanjswift Great question. If no If there are
So yes, to answer your question, we do delete files, but we don't delete all files, just those that shouldn't be around anymore. This is all handled via our Can you paste your tasks config? May help uncover any issues. |
Beta Was this translation helpful? Give feedback.
@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: