You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment the only way to pass a context through when making requests is to use WithContext(ctx) from logger.go:76, but this sets the context globally on bot.ctx (defined here). This is an issue for us because this means we cannot pass in a context for each individual request, since bot.ctx will be shared among all concurrent requests.
We want to use the context to provide request specific information (such as log ids and tracing spans) to the logger and potentially update the current implementation to use http.NewRequestWithContext instead of http.NewRequest (here) to allow cancellation/timeout of requests.
Instead of having a single context associated with a Bot instance, we would like to be able pass a context with each request.
The text was updated successfully, but these errors were encountered:
Thanks for reporting. This is a known issue because of early design. It will be a breaking change if we introduce context. Maybe I should launch V4 for support this.
At the moment the only way to pass a context through when making requests is to use
WithContext(ctx)
from logger.go:76, but this sets the context globally onbot.ctx
(defined here). This is an issue for us because this means we cannot pass in a context for each individual request, sincebot.ctx
will be shared among all concurrent requests.We want to use the context to provide request specific information (such as log ids and tracing spans) to the logger and potentially update the current implementation to use
http.NewRequestWithContext
instead ofhttp.NewRequest
(here) to allow cancellation/timeout of requests.Instead of having a single context associated with a Bot instance, we would like to be able pass a context with each request.
The text was updated successfully, but these errors were encountered: