Skip to content

How to await echo.Server shutdown completed? #2957

@tisonkun

Description

@tisonkun

Previously I wrote:

	var err error
	if s.internalServer != nil {
		s.internalServer.Start()
		err = errors.Join(err, s.internalServer.Shutdown(ctx))
	}
	if s.publicServer != nil {
		err = errors.Join(err, s.publicServer.Shutdown(ctx))
	}
	if s.store != nil {
		s.store.Close()
	}
	return err

I need to wait for the publicServer and internalServer echo servers shutdown to close the backend store. Now echo.Server has no Shutdown method, how can I easily await for its shutting down complete?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions