Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed

Conversation

AlexAxthelm
Copy link
Collaborator

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

Closes: #182

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

Closes: #182
@AlexAxthelm AlexAxthelm requested a review from cjyetman as a code owner April 18, 2024 16:02
@AlexAxthelm
Copy link
Collaborator Author

From: #182 (comment)

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
Copy link
Member

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

@cjyetman cjyetman requested a review from jdhoffa April 22, 2024 10:19
@AlexAxthelm
Copy link
Collaborator Author

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.

@AlexAxthelm AlexAxthelm deleted the perf/182-do-not-create-directories-unnecessarily branch April 23, 2024 07:29
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.

Move output directory creation to after pre-flight activities
2 participants