feat: remove buntdb deps

This commit is contained in:
2024-12-02 00:01:03 +03:30
parent 3e77ac121a
commit e42731858d
3 changed files with 1 additions and 13 deletions

View File

@@ -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