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