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

fix: update label to indicate job is attempting to run now #592

Merged
1 commit merged into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 8 additions & 3 deletions src/components/JobTable/NextRun.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ const NextRun = ({ nextExecutionTime, enabled }) => {
const nextRunIsInPast = nextRun.getTime() <= now

/**
* If the time is in the past, that could mean that the task is running,
* and the nextExecutionTime hasn't been updated yet.
* If the nextExecutionTime is in the past that means that
* the scheduled execution time has passed, but the allowed
* startup delay hasn't expired yet. Effectively this means
* that the backend will start the job as soon as possible.
*
* If the window expires before the job can execute the
* nextExecutionTime will be updated to a time in the future.
*/

if (nextRunIsInPast) {
return i18n.t('Not scheduled')
return i18n.t('Now')
}

return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/JobTable/NextRun.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ describe('<NextRun>', () => {
expect(wrapper.find(Tooltip).prop('content')).toEqual(expected)
})

it('returns fallback message for an enabled job and a past execution time', () => {
const expected = 'Not scheduled'
it('returns message for an enabled job and a past execution time', () => {
const expected = 'Now'
jest.spyOn(global.Date, 'now').mockImplementation(() => now)

const wrapper = shallow(
Expand Down
Loading