RMI-PACTA / workflow.data.preparation

The goal of `workflow.data.preparation` is to prepare all of the necessary data inputs for the Transition Monitor web application.
Other
2 stars 0 forks source link

perf(app): #182 move directory creation later #224

Closed AlexAxthelm closed 6 months ago

AlexAxthelm commented 6 months ago

Move directory creation to just prior to writing the first file to output directory, so that it is not created unnecessarily.

Closes: #182

AlexAxthelm commented 6 months ago

From: https://github.com/RMI-PACTA/workflow.data.preparation/issues/182#issuecomment-1972878210

I could add on on.exit() hook to remove the directory if it doesn't contain any files (or on any condition), which should run even if there's an error.

I think that delaying creation is a better solution than creating and then removing (robust against system crashes)

cjyetman commented 6 months ago

Where do the pre-flight files get saved if config[["preflight_data_path"]] == ""?

AlexAxthelm commented 6 months ago

Where do the pre-flight files get saved if config[["preflight_data_path"]] == ""?

Hmm. fair point. That would error out. I don't see a good way to resolve that, so I think we can live with the extra directories being created.