feat: remove buntdb deps
This commit is contained in:
@@ -2,16 +2,14 @@ package managed_job
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/dgraph-io/badger/v4"
|
||||
"github.com/tidwall/buntdb"
|
||||
)
|
||||
|
||||
// get state of job from local db
|
||||
func (job *ManagedJob) loadState() {
|
||||
err := job.db.View(
|
||||
job.db.View(
|
||||
func(tx *buntdb.Tx) error {
|
||||
if val, err := tx.Get(string(job.def.GetUID())); err != nil {
|
||||
return err
|
||||
@@ -19,9 +17,6 @@ func (job *ManagedJob) loadState() {
|
||||
return json.Unmarshal([]byte(val), job.state)
|
||||
}
|
||||
})
|
||||
if errors.Is(err, badger.ErrKeyNotFound) {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
|
||||
// save state of job to local db
|
||||
|
||||
Reference in New Issue
Block a user