update code

master
兔子 1 year ago
parent af71724029
commit fb472fcece

@ -5,6 +5,7 @@ import (
"b612.me/stardb" "b612.me/stardb"
"b612.me/startimer" "b612.me/startimer"
"errors" "errors"
"fmt"
"sync" "sync"
"time" "time"
) )
@ -72,11 +73,11 @@ func innerLoadDB(db *stardb.StarDB, callback func(task Task)) (*Remind, error) {
*itask = task *itask = task
tmr, err := startimer.NewTimer(time.Now()) tmr, err := startimer.NewTimer(time.Now())
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("error while init:%s error:%v", itask.Origin, err)
} }
err = tmr.ImportRepeats(itask.TmrInfo) err = tmr.ImportRepeats(itask.TmrInfo)
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("error while import:%s error:%v", itask.Origin, err)
} }
tmr.SetRunCountLimit(int(itask.Limit)) tmr.SetRunCountLimit(int(itask.Limit))
itask.timer = &tmr itask.timer = &tmr

Loading…
Cancel
Save