-
Notifications
You must be signed in to change notification settings - Fork 25
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
added retry & timeout fields #371
base: main
Are you sure you want to change the base?
Changes from all commits
6df1fe6
6850f50
3095ed2
144b82c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -64,3 +64,65 @@ export function NameError(name: string, trans: TranslationBundle): string { | |||||
'Name must contain only letters, numbers, spaces, periods, hyphens, and underscores' | ||||||
); | ||||||
} | ||||||
|
||||||
export function MaxRetryAttemptsError(maxRetryAttempts: string, trans: TranslationBundle): string { | ||||||
// Check for blank | ||||||
if (maxRetryAttempts === '') { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be an optional parameter, since existing users editing job definitions will not have these values set. |
||||||
return trans.__('You must specify max retry attempts'); | ||||||
} | ||||||
|
||||||
const integerValue = parseInt(maxRetryAttempts) | ||||||
if (isNaN(integerValue)) { | ||||||
return trans.__( | ||||||
'Max retry attempts must be an integer' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Explain the acceptable range in the error |
||||||
); | ||||||
} | ||||||
|
||||||
// Check for length. | ||||||
if (integerValue < 1 || integerValue > 30) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use symbolic constants to indicate the minimum and maximum acceptable values. Why isn't 0 an acceptable value? It would fit if I wanted a job to be tried only once, and never retried if it fails. |
||||||
return trans.__('Max retry attempts must be between 1 and 30'); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Explain the acceptable range in the error |
||||||
} | ||||||
|
||||||
return ''; | ||||||
} | ||||||
|
||||||
export function MaxRunTimeError(maxRunTime: string, trans: TranslationBundle): string { | ||||||
// Check for blank | ||||||
if (maxRunTime === '') { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be an optional parameter, since existing users editing job definitions will not have these values set. |
||||||
return trans.__('You must specify max run time'); | ||||||
} | ||||||
|
||||||
const integerValue = parseInt(maxRunTime) | ||||||
if (isNaN(integerValue)) { | ||||||
return trans.__( | ||||||
'Max run time must be an integer' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
); | ||||||
} | ||||||
|
||||||
// Check for length. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix or delete this comment |
||||||
if (integerValue < 1) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use a symbolic constant |
||||||
return trans.__('Max run time must be greater than 1'); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
return ''; | ||||||
} | ||||||
|
||||||
export function MaxWaitTimeError(maxWaitTime: string, trans: TranslationBundle): string { | ||||||
// Check for blank | ||||||
if (maxWaitTime === '') { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be an optional parameter, since existing users editing job definitions will not have these values set. |
||||||
return trans.__('You must specify max run time'); | ||||||
} | ||||||
const integerValue = parseInt(maxWaitTime) | ||||||
if (isNaN(integerValue)) { | ||||||
return trans.__( | ||||||
'Max wait time must be an integer' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
); | ||||||
} | ||||||
|
||||||
// Check for length. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix or delete this comment |
||||||
if (integerValue < 1) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use a symbolic constant |
||||||
return trans.__('Max wait time must be greater than 1'); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
return ''; | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is copied from the code for setting parameters, which have user-provided names and values. Your change is intended to add input fields with only user-provided values.