Skip to content
This repository was archived by the owner on Nov 23, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: go
go:
- 1.3
- 1.4
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of mutexes I use atomic.Value in our test, this was not available in go1.3.

- release
- tip
Expand Down
8 changes: 6 additions & 2 deletions chainstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ func (c *Chain) Put(ctx context.Context, key string, val []byte) (err error) {
return
}
if c.async {
go fn()
go func() {
_ = fn()
}()
} else {
err = fn()
}
Expand Down Expand Up @@ -149,7 +151,9 @@ func (c *Chain) Del(ctx context.Context, key string) (err error) {
return
}
if c.async {
go fn()
go func() {
_ = fn()
}()
} else {
err = fn()
}
Expand Down
2 changes: 1 addition & 1 deletion chainstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestAsyncChain(t *testing.T) {
assert.Nil(err) // no error because sync store took it fine

time.Sleep(time.Second * 1) // wait for async operation..
assert.NotEmpty(errored.Load())
assert.NotNil(errored.Load())
}

type testStore struct{}
Expand Down