mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-09-16 04:19:13 +00:00
fix(dispatcher): place nolint:gosec on go statement, not inside goroutine
This commit is contained in:
@@ -67,10 +67,9 @@ func Install(b *bot.Bot, reg *Registry, auth Auth) {
|
||||
return // silent — do not leak existence of gated commands
|
||||
}
|
||||
metrics.IncCommand(cmdCopy.Name)
|
||||
go func() {
|
||||
// context.Background is intentional: the hook must outlive the request
|
||||
// context so stats writes complete even after the handler returns.
|
||||
//nolint:gosec // G118: goroutine intentionally detached from request context
|
||||
// context.Background is intentional: the hook must outlive the request
|
||||
// context so stats writes complete even after the handler returns.
|
||||
go func() { //nolint:gosec // G118: goroutine intentionally detached from request context
|
||||
hookCtx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
||||
defer cancel()
|
||||
reg.RunCommandHooks(hookCtx, cmdCopy.Name)
|
||||
|
||||
Reference in New Issue
Block a user