Skip to content

refreshKey in background routine should have Background context? #16

@andresvia

Description

@andresvia

By the time sem is released the context may have been done, if is ok to use context.Background() I'll be happy to open a PR.

go-jwks/client.go

Lines 63 to 68 in f5cc55a

go func() {
defer c.sem.Release(1)
if _, err := c.refreshKey(ctx, keyId, use); err != nil {
logger.Printf("unable to refresh key: %v", err)
}
}()

seeing this message in production prompted me to come here and create this issue:

unable to refresh key: Get "<the jwks source url>": context canceled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions