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
feat(mis): 增加允许改变作业时限的hook: allowChangeJobTimeLimit #1229
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 29199d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
const { cluster, limitMinutes, jobId } = request; | ||
const { cluster, limitMinutes, jobId, operatorUserId } = request; | ||
|
||
await callHook("allowChangeJobTimeLimit", { cluster, limitMinutes, jobId, operatorUserId }, logger); |
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.
这个调用时机应该是改变了作业时限changeJobTimeLimit,而不是允许改变吧?
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.
这个hook是让外界的服务来决定是否能够修改作业时限,所以要在调用适配器之前就调用。暂时想法是外界如果有hook服务,如果 该hook正常返回,就继续执行,如果外界服务不允许更改作业时限,那将返回错误,scow这边再抛出错误
增加改变作业时限的hook: allowChangeJobTimeLimit
功能:
当修改作业时限时,将cluster、limitMinutes、jobId、operatorUserId作为传参调用hook,可以由外部hook调用的服务来决定允许修改或者抛出错误。