Skip to content

🚀 [Feature]: Sustainably prevent data races #2400

Open
@leonklingele

Description

@leonklingele

Feature Description

The data race "fixed" in https://github.com/gofiber/fiber/pull/2368/files wasn't fixed at all.

Instead we should do something à la:

func (s *Storage) ConnLocked(fn func(map[string]entry)) {
    s.mux.Lock()
    defer s.mux.Unlock()
    fn(s.db)
}

Additional Context (optional)

No response

Code Snippet (optional)

No response

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions