Skip to content

Commit

Permalink
removed agent parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Golev committed Mar 12, 2020
1 parent a261c8e commit 361d13e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dkron/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ func (a *Agent) StartServer() {
}

if a.Store == nil {
s, err := NewStore(a)
s, err := NewStore()
if err != nil {
log.WithError(err).Fatal("dkron: Error initializing store")
}
Expand Down
4 changes: 2 additions & 2 deletions dkron/job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func TestJobGetParent(t *testing.T) {
s, err := NewStore(nil)
s, err := NewStore()
defer s.Shutdown()
require.NoError(t, err)

Expand Down Expand Up @@ -99,7 +99,7 @@ func TestToProto(t *testing.T) {
}

func Test_isRunnable(t *testing.T) {
s, err := NewStore(nil)
s, err := NewStore()
a := &Agent{
Store: s,
}
Expand Down
2 changes: 1 addition & 1 deletion dkron/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type kv struct {
}

// NewStore creates a new Storage instance.
func NewStore(a *Agent) (*Store, error) {
func NewStore() (*Store, error) {
db, err := buntdb.Open(":memory:")
if err != nil {
return nil, err
Expand Down
7 changes: 2 additions & 5 deletions dkron/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import (
)

func TestStore(t *testing.T) {
a := NewAgent(nil)
s, err := NewStore(a)
s, err := NewStore()
require.NoError(t, err)
defer s.Shutdown()

Expand Down Expand Up @@ -459,10 +458,8 @@ func scaffoldJob() *Job {
}

func setupStore(t *testing.T) *Store {
a := NewAgent(nil)
s, err := NewStore(a)
s, err := NewStore()
require.NoError(t, err)
a.Store = s
return s
}

Expand Down

0 comments on commit 361d13e

Please sign in to comment.