-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(job): add eligible tunable (#65)
This commit has following features: - eligible check to enable or disable a job - thinkTimeInSeconds to delay start of a Job - failFast to stop retrying in case of specific errors - ignoreError to mark a task as warning & job to completed Signed-off-by: AmitKumarDas <[email protected]>
- Loading branch information
Amit Kumar Das
authored
May 31, 2020
1 parent
bd652f3
commit 0f9fe49
Showing
29 changed files
with
1,153 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
Copyright 2020 The MayaData Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package job | ||
|
||
import types "mayadata.io/d-operators/types/job" | ||
|
||
// BaseRunner is the common runner used by all action runners | ||
type BaseRunner struct { | ||
*Fixture | ||
TaskIndex int | ||
TaskName string | ||
Retry *Retryable | ||
FailFastRule types.FailFastRule | ||
} | ||
|
||
// IsFailFastOnDiscoveryError returns true if logic that leads to | ||
// discovery error should not be re-tried | ||
func (r *BaseRunner) IsFailFastOnDiscoveryError() bool { | ||
return r.FailFastRule == types.FailFastOnDiscoveryError | ||
} | ||
|
||
// IsFailFastOnError returns true if logic that lead to given error | ||
// should not be re-tried | ||
func (r *BaseRunner) IsFailFastOnError(err error) bool { | ||
if _, discoveryErr := err.(*DiscoveryError); discoveryErr { | ||
return r.IsFailFastOnDiscoveryError() | ||
} | ||
return false | ||
} |
Oops, something went wrong.