diff --git a/ROADMAP.md b/ROADMAP.md index 517c6126..83f9723a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -22,7 +22,7 @@ We hope that the items listed below will inspire further engagement from the com ## 2022 - [x] Support `context` in redis related methods for timeout and tracing - [x] Support `context` in sql related methods for timeout and tracing -- [ ] Support `context` in mongodb related methods for timeout and tracing +- [x] Support `context` in mongodb related methods for timeout and tracing - [x] Add `httpc.Do` with HTTP call governance, like circuit breaker etc. - [ ] Support `goctl doctor` command to report potential issues for given service - [ ] Support `goctl mock` command to start a mocking server with given `.api` file diff --git a/core/bloom/bloom.go b/core/bloom/bloom.go index a3ab8a29..bc08df25 100644 --- a/core/bloom/bloom.go +++ b/core/bloom/bloom.go @@ -69,6 +69,7 @@ func (f *Filter) Exists(data []byte) (bool, error) { if err != nil { return false, err } + return isSet, nil } diff --git a/core/logx/rotatelogger_test.go b/core/logx/rotatelogger_test.go index a7486d95..358fe716 100644 --- a/core/logx/rotatelogger_test.go +++ b/core/logx/rotatelogger_test.go @@ -98,6 +98,10 @@ func TestRotateLoggerRotate(t *testing.T) { case *os.LinkError: // avoid rename error on docker container assert.Equal(t, syscall.EXDEV, v.Err) + case *os.PathError: + // ignore remove error for tests, + // files are cleaned in GitHub actions. + assert.Equal(t, "remove", v.Op) default: assert.Nil(t, err) } diff --git a/zrpc/internal/serverinterceptors/statinterceptor.go b/zrpc/internal/serverinterceptors/statinterceptor.go index 52700d3a..16302c14 100644 --- a/zrpc/internal/serverinterceptors/statinterceptor.go +++ b/zrpc/internal/serverinterceptors/statinterceptor.go @@ -26,7 +26,6 @@ func SetSlowThreshold(threshold time.Duration) { func UnaryStatInterceptor(metrics *stat.Metrics) grpc.UnaryServerInterceptor { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { - startTime := timex.Now() defer func() { duration := timex.Since(startTime)