From bac2580be7d7688eb7c18306a5a5b76f271ea08e Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Sat, 22 Feb 2025 14:18:01 +0100 Subject: [PATCH] fix create core object's context --- core/endpoint.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/endpoint.go b/core/endpoint.go index 5e7f581..ea1514e 100644 --- a/core/endpoint.go +++ b/core/endpoint.go @@ -14,13 +14,13 @@ func (c *Core) AddInbound(config []byte) error { } var err error var inbound_config option.Inbound - err = inbound_config.UnmarshalJSONContext(globalCtx, config) + err = inbound_config.UnmarshalJSONContext(c.GetCtx(), config) if err != nil { return err } err = inbound_manager.Create( - globalCtx, + c.GetCtx(), router, factory.NewLogger("inbound/"+inbound_config.Type+"["+inbound_config.Tag+"]"), inbound_config.Tag, @@ -48,7 +48,7 @@ func (c *Core) AddOutbound(config []byte) error { var err error var outbound_config option.Outbound - err = outbound_config.UnmarshalJSONContext(globalCtx, config) + err = outbound_config.UnmarshalJSONContext(c.GetCtx(), config) if err != nil { return err } @@ -86,13 +86,13 @@ func (c *Core) AddEndpoint(config []byte) error { var err error var endpoint_config option.Endpoint - err = endpoint_config.UnmarshalJSONContext(globalCtx, config) + err = endpoint_config.UnmarshalJSONContext(c.GetCtx(), config) if err != nil { return err } err = endpoint_manager.Create( - globalCtx, + c.GetCtx(), router, factory.NewLogger("endpoint/"+endpoint_config.Type+"["+endpoint_config.Tag+"]"), endpoint_config.Tag,