From 7bb0ae01b2e975d56200db8f6ad6d1c3335d44d6 Mon Sep 17 00:00:00 2001 From: lenhattan86 Date: Thu, 16 Sep 2021 15:57:23 -0700 Subject: [PATCH] add priority in deep copy and jobUpdate --- jobUpdate.go | 5 +++++ task.go | 3 ++- task_test.go | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/jobUpdate.go b/jobUpdate.go index 3ef2cb4..0f231f2 100644 --- a/jobUpdate.go +++ b/jobUpdate.go @@ -221,6 +221,11 @@ func (j *JobUpdate) IsService(isService bool) *JobUpdate { return j } +func (j *JobUpdate) Priority(priority int32) *JobUpdate { + j.task.Priority(priority) + return j +} + func (j *JobUpdate) TaskConfig() *aurora.TaskConfig { return j.task.TaskConfig() } diff --git a/task.go b/task.go index a6e9f5a..e055190 100644 --- a/task.go +++ b/task.go @@ -78,7 +78,8 @@ func TaskFromThrift(config *aurora.TaskConfig) *AuroraTask { Role(config.Job.Role). Name(config.Job.Name). MaxFailure(config.MaxTaskFailures). - IsService(config.IsService) + IsService(config.IsService). + Priority(config.Priority) if config.Tier != nil { newTask.Tier(*config.Tier) diff --git a/task_test.go b/task_test.go index 14d06c8..deaf7b1 100644 --- a/task_test.go +++ b/task_test.go @@ -34,6 +34,7 @@ func TestAuroraTask_Clone(t *testing.T) { RAM(643). Disk(1000). IsService(true). + Priority(1). AddPorts(10). Tier("preferred"). MaxFailure(23).