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

Allow missing mode folders in production mode #448

Merged

Conversation

avanwinkle
Copy link
Collaborator

@avanwinkle avanwinkle commented Sep 12, 2023

This PR makes a small change to running MPF MC in production mode for optimized performance. During the production build, mode config files are consolidated into a single bundle and individual mode folders with modes/<mode_name>/config/<mode_name>.yaml files are not necessary.

Without the need for individual config files, the exported machine code does not need separate folders for all modes. MPF manages just fine in this way, but MC throws on bootup because the mode folders are empty. This PR changes the MC startup code to allow missing mode folders while in production mode.

Caveat: Modes that have specific media assets, like sounds: or videos: still require having a mode folder with those subfolders for the assets. If the root mode folder is missing, skipping this check will expose a downstream error where an expected media file is missing. Perhaps an error on the media file instead of the mode folder is less helpful, but given the constraints I'm okay with it.

where is it?

@avanwinkle
Copy link
Collaborator Author

Tried re-running the failed test machine a few times, looks to be a race condition that previous PRs have also failed on. Proceeding with merge due to low risk.

@avanwinkle avanwinkle merged commit 90f0917 into missionpinball:dev Sep 13, 2023
avanwinkle added a commit to avanwinkle/mpf-mc that referenced this pull request Sep 13, 2023
…-missing-folders

Allow missing mode folders in production mode

(cherry picked from commit 90f0917)
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.

1 participant