Skip to content

🚀 [Feature]: Allow to stop the timestamp updater #69

@leonklingele

Description

@leonklingele

Feature Description

There should be a way to stop the timestamp updater again so we don't leak a goroutine.

When using Uber's goleak you have to manually ignore these after shutting down the fiber server:

package handlers_test

import (
	"testing"

	"go.uber.org/goleak"
)

func TestMain(m *testing.M) {
	goleak.VerifyTestMain(
		m,
		// TODO: Fix those leaks upstream
		goleak.IgnoreTopFunction("time.Sleep"), // https://github.com/valyala/fasthttp/blob/0be5a4150cb0e35605cffd09e922707355dbdec3/fs.go#L477-L480
		goleak.IgnoreTopFunction("github.com/gofiber/fiber/v2/internal/memory.(*Storage).gc"),
		goleak.IgnoreTopFunction("github.com/gofiber/fiber/v2/internal/storage/memory.(*Storage).gc"),
		goleak.IgnoreTopFunction("github.com/gofiber/fiber/v2/internal/storage/memory.New.StartTimeStampUpdater.func1.1"),
		goleak.IgnoreTopFunction("github.com/gofiber/fiber/v2/utils.StartTimeStampUpdater.func1.1"),
	)
}

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