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

Load profiles from file instead of config #10

Open
cswaney opened this issue Jun 13, 2024 · 0 comments
Open

Load profiles from file instead of config #10

cswaney opened this issue Jun 13, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@cswaney
Copy link
Member

cswaney commented Jun 13, 2024

The application doesn't pick up changes to profiles because it uses the state of the profiles file at the time the app is launched (the state is loaded into config).

The simplest solution is to instead store the location of the profiles file and reload this file every time that profiles are needed. This is slower, but it allows us to keep profiles in an easily editable format (versus storing profiles in the database), and still gives us fresh profile data on every call.

More specifically, we currently store profiles in config.BLACKFISH_PROFILES as BlackfishProfiles. Everywhere that we currently use config.BLACKFISH_PROFILES, we need to instead store the profile path to config.BLACKFISH_PROFILE and run:

profiles = load_profiles(config.BLACKFISH_PROFILE)
profile = profiles[name]

every time that we need a profile.

@cswaney cswaney self-assigned this Sep 18, 2024
@cswaney cswaney added the bug Something isn't working label Sep 18, 2024
@cswaney cswaney changed the title Restart after profile created/edited? Load profiles from file instead of config Sep 18, 2024
@cswaney cswaney added this to the v0.1.0 milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant