-
Notifications
You must be signed in to change notification settings - Fork 3
/
state.go
38 lines (31 loc) · 732 Bytes
/
state.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package sched
//State Indicate the state of the Schedule
type State int64
const (
//NEW Schedule has just been created and hasn't started before
NEW State = iota
// STARTED Start Schedule has started and is running.
STARTED
// STOPPING Schedule is Stopping and is waiting for all active jobs to finish.
STOPPING
// STOPPED Schedule has stopped and no longer scheduling new Jobs.
STOPPED
// FINISHED Schedule has finished, and will not be able to start again.
FINISHED
)
func (s State) String() string {
switch s {
case NEW:
return "NEW"
case STARTED:
return "STARTED"
case STOPPING:
return "STOPPING"
case STOPPED:
return "STOPPED"
case FINISHED:
return "FINISHED"
default:
return "UNKNOWN"
}
}