Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: scheduler/appengine/engine/engine.go

Issue 2948103002: scheduler: rename JobID to JobName to avoid overloading JobID meaning. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 // Package engine implements the core logic of the scheduler service. 5 // Package engine implements the core logic of the scheduler service.
6 package engine 6 package engine
7 7
8 import ( 8 import (
9 "bytes" 9 "bytes"
10 "encoding/json" 10 "encoding/json"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 Schedule string `gae:",noindex"` 250 Schedule string `gae:",noindex"`
251 251
252 // Task is the job's payload in serialized form. Opaque from the point o f view 252 // Task is the job's payload in serialized form. Opaque from the point o f view
253 // of the engine. See Catalog.UnmarshalTask(). 253 // of the engine. See Catalog.UnmarshalTask().
254 Task []byte `gae:",noindex"` 254 Task []byte `gae:",noindex"`
255 255
256 // State is the job's state machine state, see StateMachine. 256 // State is the job's state machine state, see StateMachine.
257 State JobState 257 State JobState
258 } 258 }
259 259
260 func (e *Job) GetJobName() string {
tandrii(chromium) 2017/06/21 16:16:07 it seems you've meant to avoid public functions he
261 // JobID has form <project>/<id>. Split it into components.
262 chunks := strings.Split(e.JobID, "/")
263 return chunks[1]
264 }
265
260 // effectiveSchedule returns schedule string to use for the job, considering its 266 // effectiveSchedule returns schedule string to use for the job, considering its
261 // Paused field. 267 // Paused field.
262 // 268 //
263 // Paused jobs always use "triggered" schedule. 269 // Paused jobs always use "triggered" schedule.
264 func (e *Job) effectiveSchedule() string { 270 func (e *Job) effectiveSchedule() string {
265 if e.Paused { 271 if e.Paused {
266 return "triggered" 272 return "triggered"
267 } 273 }
268 return e.Schedule 274 return e.Schedule
269 } 275 }
(...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 } 1936 }
1931 if hasFinished { 1937 if hasFinished {
1932 return ctl.eng.rollSM(c, job, func(sm *StateMachine) err or { 1938 return ctl.eng.rollSM(c, job, func(sm *StateMachine) err or {
1933 sm.OnInvocationDone(saving.ID) 1939 sm.OnInvocationDone(saving.ID)
1934 return nil 1940 return nil
1935 }) 1941 })
1936 } 1942 }
1937 return nil 1943 return nil
1938 }) 1944 })
1939 } 1945 }
OLDNEW
« no previous file with comments | « scheduler/appengine/apiservers/scheduler_test.go ('k') | scheduler/appengine/frontend/templates/includes/base.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698