mirror of
https://github.com/zrepl/zrepl.git
synced 2025-06-20 09:47:50 +02:00
fixup
This commit is contained in:
parent
a0b320bfeb
commit
74445a0017
@ -10,8 +10,6 @@ import (
|
|||||||
"github.com/zrepl/zrepl/util"
|
"github.com/zrepl/zrepl/util"
|
||||||
"github.com/zrepl/zrepl/cmd/replication"
|
"github.com/zrepl/zrepl/cmd/replication"
|
||||||
"github.com/problame/go-streamrpc"
|
"github.com/problame/go-streamrpc"
|
||||||
"io"
|
|
||||||
"net"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type PullJob struct {
|
type PullJob struct {
|
||||||
|
@ -219,7 +219,7 @@ func (j *SourceJob) handleConnection(conn net.Conn, task *Task) {
|
|||||||
// rpcServer.SetLogger(rpclog, true)
|
// rpcServer.SetLogger(rpclog, true)
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if err := streamrpc.ServeConn(rwc, STREAMRPC_CONFIG, handler.Handle); err != nil {
|
if err := streamrpc.ServeConn(context.TODO(), conn, STREAMRPC_CONFIG, handler.Handle); err != nil {
|
||||||
task.Log().WithError(err).Error("error serving connection")
|
task.Log().WithError(err).Error("error serving connection")
|
||||||
} else {
|
} else {
|
||||||
task.Log().Info("client closed connection")
|
task.Log().Info("client closed connection")
|
||||||
|
@ -325,9 +325,8 @@ type HandlerAdaptor struct {
|
|||||||
log Logger
|
log Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *HandlerAdaptor) Handle(endpoint string, reqStructured *bytes.Buffer, reqStream io.ReadCloser) (resStructured *bytes.Buffer, resStream io.ReadCloser, err error) {
|
func (a *HandlerAdaptor) Handle(ctx context.Context, endpoint string, reqStructured *bytes.Buffer, reqStream io.ReadCloser) (resStructured *bytes.Buffer, resStream io.ReadCloser, err error) {
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
if a.log != nil {
|
if a.log != nil {
|
||||||
// FIXME validate type conversion here?
|
// FIXME validate type conversion here?
|
||||||
ctx = context.WithValue(ctx, streamrpc.ContextKeyLogger, a.log)
|
ctx = context.WithValue(ctx, streamrpc.ContextKeyLogger, a.log)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user