Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: implement scheduling mechanism for prebuilds#18126

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Changes from1 commit
Commits
Show all changes
46 commits
Select commitHold shift + click to select a range
47cb6fc
feat: implement autoscaling mechanism for prebuilds
evgeniy-scherbinaMay 29, 2025
0f4d521
fix: precision issue with is-within-range function
evgeniy-scherbinaJun 13, 2025
b957eb6
test: fix is-within-range test
evgeniy-scherbinaJun 13, 2025
de920b8
test: minor fixes in is-within-range test
evgeniy-scherbinaJun 13, 2025
5d31b43
test: fix tests failed due to is-within-range function
evgeniy-scherbinaJun 13, 2025
b3130a8
fix: migration numbers
evgeniy-scherbinaJun 13, 2025
0565fb7
feat: define functions for validation of schedules
evgeniy-scherbinaJun 15, 2025
99d76e5
Merge remote-tracking branch 'origin/main' into yevhenii/prebuilds-au…
evgeniy-scherbinaJun 15, 2025
bdfcd9e
regenerate protofiles
evgeniy-scherbinaJun 15, 2025
ea7766f
test: improve test coverage for schedules-overlap function
evgeniy-scherbinaJun 15, 2025
1e78317
test: improve test coverage for validate-schedules function
evgeniy-scherbinaJun 16, 2025
5d99ef1
refactor: add logger to preset-snapshot
evgeniy-scherbinaJun 16, 2025
158b92e
refactor: fallback to default on error in calc-desired-instances
evgeniy-scherbinaJun 16, 2025
396d080
refactor: change signature of calc-desired-instances
evgeniy-scherbinaJun 16, 2025
12dba6c
fix: improve schedule validation
evgeniy-scherbinaJun 16, 2025
3fa98b2
fix: bug related to DOM and DOW interpretation
evgeniy-scherbinaJun 16, 2025
8a063ff
fix: add schedules validation
evgeniy-scherbinaJun 16, 2025
12d3d88
fix: use TimeRange function instead of Weekly
evgeniy-scherbinaJun 16, 2025
3facaf2
fix: linter
evgeniy-scherbinaJun 17, 2025
6ce7ff2
fix: migration numbers
evgeniy-scherbinaJun 17, 2025
178676f
Merge remote-tracking branch 'origin/main' into yevhenii/prebuilds-au…
evgeniy-scherbinaJun 17, 2025
368fb36
deps: update version of tf-provider-coder
evgeniy-scherbinaJun 17, 2025
44b67ae
refactor: use ValidateSchedules from tf-provider-coder
evgeniy-scherbinaJun 17, 2025
df202c2
fix: CR's fixes
evgeniy-scherbinaJun 17, 2025
affee62
Update coderd/database/dbgen/dbgen.go
evgeniy-scherbinaJun 17, 2025
909d950
refactor: rename instances to desired_instances for consistency
evgeniy-scherbinaJun 17, 2025
e08f8d2
fix: make gen
evgeniy-scherbinaJun 17, 2025
4da1e64
fix: migrations test
evgeniy-scherbinaJun 17, 2025
4d2557c
fix: optimize get-preset-prebuild-schedules query
evgeniy-scherbinaJun 17, 2025
faf9ec7
refactor: rename DB method
evgeniy-scherbinaJun 17, 2025
821eda7
refactor: rename autoscaling to scheduling
evgeniy-scherbinaJun 18, 2025
7617042
refactor: rename autoscaling to scheduling (migration files)
evgeniy-scherbinaJun 18, 2025
6c2350f
refactor: minor refactor after renaming
evgeniy-scherbinaJun 18, 2025
cacdb1f
deps: update version of tf-provider-coder
evgeniy-scherbinaJun 18, 2025
8d2c08e
gen: make gen
evgeniy-scherbinaJun 18, 2025
5600054
docs: document api changes in proto/version.go
evgeniy-scherbinaJun 18, 2025
2215a9e
test: extend convert-resources test with prebuilds.scheduling
evgeniy-scherbinaJun 18, 2025
69ab8e1
fix: make gen
evgeniy-scherbinaJun 19, 2025
4a29496
refactor: make fmt
evgeniy-scherbinaJun 19, 2025
8edb051
deps: update version of tf-provider-coder
evgeniy-scherbinaJun 19, 2025
954bf66
Merge remote-tracking branch 'origin/main' into yevhenii/prebuilds-au…
evgeniy-scherbinaJun 19, 2025
2d945cf
fix: migration numbers
evgeniy-scherbinaJun 19, 2025
533a2b5
refactor: fix formatting
evgeniy-scherbinaJun 19, 2025
2b7119a
fix: set scheduling_timezone to empty string by default
evgeniy-scherbinaJun 19, 2025
96caa18
refactor: improve logging
evgeniy-scherbinaJun 19, 2025
83872d6
refactor: improve logging
evgeniy-scherbinaJun 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
fix: precision issue with is-within-range function
Co-authored-by: Danny Kopping <danny@coder.com>
  • Loading branch information
@evgeniy-scherbina@dannykopping
evgeniy-scherbina anddannykopping authoredJun 13, 2025
commit0f4d521a231b55d7cff6b6c936301e446d5e635c
15 changes: 10 additions & 5 deletionscoderd/schedule/cron/cron.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -163,11 +163,16 @@ func (s Schedule) Next(t time.Time) time.Time {
// However, due to minor implementation imprecision, it is interpreted as
// a range from 08:59:00 to 18:58:59, Monday through Friday.
func (s Schedule) IsWithinRange(t time.Time) bool {
// Get the next scheduled time
next := s.Next(t)

// If the next time is more than a minute away, we're not within range
return next.Sub(t) <= time.Minute
// Truncate to the beginning of the current minute.
currentMinute := t.Truncate(time.Minute)

// Go back 1 second from the current minute to find what the next scheduled time would be.
justBefore := currentMinute.Add(-time.Second)
next := s.Next(justBefore)

// If the next scheduled time is exactly at the current minute,
// then we are within the range.
return next.Equal(currentMinute)
}

var (
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp