mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-05-07 10:05:54 +00:00
pull all non-request scoped values out of context
This commit is contained in:
@@ -73,15 +73,9 @@ func (rc *RedisClient) Printf(ctx context.Context, format string, v ...interface
|
||||
rc.logger.Debug(msg)
|
||||
}
|
||||
|
||||
func (rc *RedisClient) Start(ctx context.Context) error {
|
||||
func (rc *RedisClient) Start(ctx context.Context, router common.RouteIO) error {
|
||||
redis.SetLogger(rc)
|
||||
rc.logger.Debug("running")
|
||||
router, ok := ctx.Value(common.RouterContextKey).(common.RouteIO)
|
||||
|
||||
if !ok {
|
||||
return errors.New("redis.client unable to get router from context")
|
||||
}
|
||||
|
||||
rc.router = router
|
||||
moduleContext, cancel := context.WithCancel(ctx)
|
||||
rc.ctx = moduleContext
|
||||
|
||||
Reference in New Issue
Block a user