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

Added params callback to rescheduleIfNeeded #87

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

steveklett
Copy link
Contributor

resolves request #86

  1. Added params callback to rescheduleIfNeeded - resolves request Add support for rescheduleIfNeeded to take a callback function for the parameter object #86
  2. Added additional logging to rescheduleIfNeeded to report the params value
  3. Added additional details to governanceRemains() comments, cautioning against using null for skipped parameters

Note: Many javascript files included due to line ending differences. Source has CRLF and my local as LF (unix). There is an editorconfig file that sets LF as the line separator, so I don't know why all the JS files are using CRLF
return () => {
const governanceRemains = governancePredicate();
if (!governanceRemains) {
EC_Logger_1.DefaultLogger.warn('out of governance, rescheduling', task.create({
const effectiveParams = paramsCallback ? paramsCallback() : params;
const taskID = task.create({
taskType: task.TaskType.SCHEDULED_SCRIPT,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Broke this out to support a cleaner (IMO) logging call

* @param minutes threshold for maximum number of minutes allowed to elapse.
* Note: If not setting a minute value, pass {undefined} or a very high minute value. Using {null} will
* create undesired behavior (i.e., it will return false when comparing the elapsed time to null)
*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This got me - I was passing null and kept having premature rescheduling. Finally figured out elapsed > null will return true as null is coerced to 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant