feat: add running-hours keep-warm windows and timezone support#907
Merged
Conversation
Test Results✅ All tests passed! | 329 tests in 73.894s |
|
|
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.



Summary
Closes #292
This PR adds daily running-hours support so Sablier can proactively keep selected instances warm during configured time windows.
It also includes:
examples/running-hoursUser Guide
What is new
You can now set the
sablier.running-hourslabel on managed instances:Behavior:
Supported format:
HH:MM-HH:MM(24-hour clock)22:00-06:00Invalid values are ignored with a warning.
Timezone behavior
Running-hours are evaluated in the process local timezone.
This PR ensures timezone support for container deployments by:
time/tzdata)TZ=UTCin the Docker imageOverride timezone as needed at runtime, for example:
Example added
A new runnable example is available in
examples/running-hours.It contains:
compose.ymlMakefileREADME.mdwalkthroughThe example demonstrates:
RUNNING_HOURSTZImplementation Notes
InstanceRequestexpiration logic to respect active running-hours windows.sablier.running-hours.Tests
Executed:
go test ./pkg/sablier/...Added tests cover:
Changed files
pkg/sablier/running_hours.gopkg/sablier/running_hours_watch.gopkg/sablier/instance.gopkg/sablier/instance_request.gopkg/sablier/running_hours_test.gopkg/sablier/instance_request_running_hours_test.gopkg/sablier/instance_test.gopkg/sabliercmd/start.gocmd/sablier/cmd.gobuild/Dockerfiledocs/configuration.mdexamples/running-hours/*