Gateway: Fix plan re-publish issue#4109
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a gateway execution-plan re-publish problem by ensuring the periodic “keepalive” publish rebuilds the protobuf so the embedded timestamp is refreshed (rather than re-sending cached bytes). It also adds test coverage around the new re-publish behavior and bumps the Predbat version.
Changes:
- Replaces the “re-send cached plan bytes” behavior with a rebuild-and-publish flow to refresh the plan timestamp.
- Caches the last plan inputs (entries + timezone) to support rebuilding on periodic re-publish.
- Adds unit tests validating republish interval gating and timestamp refresh semantics.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
apps/predbat/gateway.py |
Stores last plan inputs and adds _republish_plan_if_stale() to rebuild and republish a refreshed execution plan timestamp. |
apps/predbat/tests/test_gateway.py |
Adds TestPlanRepublish to verify periodic republish behavior and gating conditions. |
apps/predbat/predbat.py |
Version bump to v8.41.2. |
coverage/cases/predbat_debug_pre_saving1.yaml.expected.json |
Updates expected output for an existing debug case. |
Comment on lines
1179
to
1183
| self._last_plan_data = data | ||
| self._last_plan_entries = plan_entries | ||
| self._last_plan_timezone = timezone_str | ||
| self._last_plan_publish_time = time.time() | ||
|
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…batpred into fix/plan-re-send-gateway
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.