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

Some modules are never executed when errors persist #173

Closed
dostuffthatmatters opened this issue Jul 8, 2023 · 1 comment
Closed

Some modules are never executed when errors persist #173

dostuffthatmatters opened this issue Jul 8, 2023 · 1 comment
Assignees
Labels
status:implemented has been implemented in some dev branch

Comments

@dostuffthatmatters
Copy link
Member

Here is the order of how the different modules are executed:

pyra/packages/core/main.py

Lines 99 to 105 in dd29bae

mainloop_modules: list[Any] = [
modules.measurement_conditions.MeasurementConditions(config),
modules.enclosure_control.EnclosureControl(config),
modules.sun_tracking.SunTracking(config),
modules.opus_measurement.OpusMeasurement(config),
modules.system_checks.SystemChecks(config),
]
When one module raises an Exception, none of the modules after that will be executed. So if the enclosure or CamTracker has an error, the OPUS-module will never be executed (so OPUS will never be started or stopped accordingly).

Solution: Since modules 2 to 5 depend on 1 but not on each other, we could move the processing of any exception after all of them (2 to 5) have been executed. Then we would still toggle OPUS/CamTracker correctly and check for battery state etc. even when the enclosure has issues. The emailing logic (occurred, resolved) will not be affected.

@dostuffthatmatters dostuffthatmatters added type:bug status:planned is assigned to a specific milestone scope:camtracker labels Jul 8, 2023
@dostuffthatmatters dostuffthatmatters self-assigned this Jul 8, 2023
dostuffthatmatters added a commit that referenced this issue Jul 8, 2023
@dostuffthatmatters dostuffthatmatters added status:implemented has been implemented in some dev branch and removed status:planned is assigned to a specific milestone labels Jul 8, 2023
@patrickjaigner
Copy link
Contributor

@dostuffthatmatters thanks for the idea. I agree that this should improve the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:implemented has been implemented in some dev branch
Projects
None yet
Development

No branches or pull requests

2 participants