[WIP] factor out trace functionality into separate package and add Go docs
This commit is contained in:
@@ -3,9 +3,8 @@ package semaphore
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/zrepl/zrepl/daemon/logging/trace"
|
||||
wsemaphore "golang.org/x/sync/semaphore"
|
||||
|
||||
"github.com/zrepl/zrepl/daemon/logging"
|
||||
)
|
||||
|
||||
type S struct {
|
||||
@@ -23,7 +22,7 @@ type AcquireGuard struct {
|
||||
|
||||
// The returned AcquireGuard is not goroutine-safe.
|
||||
func (s *S) Acquire(ctx context.Context) (*AcquireGuard, error) {
|
||||
defer logging.WithSpanFromStackUpdateCtx(&ctx)()
|
||||
defer trace.WithSpanFromStackUpdateCtx(&ctx)()
|
||||
if err := s.ws.Acquire(ctx, 1); err != nil {
|
||||
return nil, err
|
||||
} else if err := ctx.Err(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user