mirror of
https://github.com/Fishwaldo/sched.git
synced 2025-07-10 06:58:28 +00:00
Rename Started state to Running
Signed-off-by: Sherif Abdel-Naby <sherifabdlnaby@gmail.com>
This commit is contained in:
parent
e7bf70c3e0
commit
980d96a4da
1 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ type State int64
|
|||
|
||||
const (
|
||||
NEW State = iota
|
||||
STARTED
|
||||
RUNNING
|
||||
FINISHED
|
||||
PANICKED
|
||||
)
|
||||
|
@ -69,7 +69,7 @@ func (j *Job) Start() error {
|
|||
func (j *Job) start() (err error) {
|
||||
j.mx.RLock()
|
||||
if j.state != NEW {
|
||||
if j.state == STARTED {
|
||||
if j.state == RUNNING {
|
||||
err = ErrorJobStarted{Message: "job already started"}
|
||||
return err
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ func (j *Job) start() (err error) {
|
|||
j.mx.RUnlock()
|
||||
|
||||
j.mx.Lock()
|
||||
j.state = STARTED
|
||||
j.state = RUNNING
|
||||
j.startTime = time.Now()
|
||||
|
||||
// Handle Panics and set correct state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue