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

chore: cover deadline crossing autostart border#13115

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
Emyrk merged 5 commits intomainfromstevenmasley/schedule_border
May 1, 2024

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedApr 30, 2024
edited
Loading

Closes#12864

This PR adds the second case in this image. If a user starts a workspace, and that TTL crosses the next autostart, the deadline is set to autostart + TTL

schedule drawio (1)

@EmyrkEmyrk marked this pull request as ready for reviewApril 30, 2024 21:20
@EmyrkEmyrk requested a review fromjohnstcnMay 1, 2024 13:20
//- This crosses the autostart deadline, so the deadline is extended to 9pm
nextAutostart, ok := NextAutostartSchedule(params.Now, params.WorkspaceAutostart, templateSchedule)
if ok && autostop.Deadline.After(nextAutostart) {
autostop.Deadline = nextAutostart.Add(ttl)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we need to handle themin(deadline, max_deadline) here too?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

No, that is handled down below.

autostop.Deadline=autostop.MaxDeadline

I'd rather not duplicate that logic since it also handles the case where MaxDeadline is not set.

johnstcn reacted with thumbs up emoji
templateAutostopRequirement: schedule.TemplateAutostopRequirement{},
userQuietHoursSchedule: "",

expectedDeadline: time.Date(pastDateNight.Year(), pastDateNight.Month(), pastDateNight.Day()+1, 21, 0, 0, 0, chicago),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

could you usepastDateNight.AddDate() here?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

AddDate cannot add hours. So it would beAddDate(0,0,1).Add(time.Hour*X) But the number of hours is 23.25 hours, which is such a strange amount.

pastDateNight = 9:45pm on Wednesday
expectedDeadline = 9pm Thursday, which is 12hrs + autostart (which is a cron string, not a Gotime.Time).

It was easier for me to reason because the offset being 23.25 hours is not really the assertion I am making. I want to assert it's 12hrs after autostart.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fair!

Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM, especially with the new test cases!

@EmyrkEmyrk merged commit845407f intomainMay 1, 2024
@EmyrkEmyrk deleted the stevenmasley/schedule_border branchMay 1, 2024 15:43
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 1, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Bump stop time even when start time occurs even if there's no activity
2 participants
@Emyrk@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp