Closed sidepelican closed 4 months ago
https://github.com/swift-server/swift-service-lifecycle/blob/f5780d95bdf3f740f14decb6c8c823815c883451/Sources/ServiceLifecycle/GracefulShutdown.swift#L118 I noticed that the cancelOnGracefulShutdown method signature suggests it returns an optional (T?). However, I couldn’t find any code paths in the implementation where a nil value would be returned.
cancelOnGracefulShutdown
T?
nil
Could you please clarify why the return type is optional in this context? Is there a scenario where this method might return nil that I might have missed?
You are right this seems like a mistake we should fix. This method indeed shouldn't return an optional. Would you be open to work on a PR for this?
https://github.com/swift-server/swift-service-lifecycle/blob/f5780d95bdf3f740f14decb6c8c823815c883451/Sources/ServiceLifecycle/GracefulShutdown.swift#L118 I noticed that the
cancelOnGracefulShutdown
method signature suggests it returns an optional (T?
). However, I couldn’t find any code paths in the implementation where anil
value would be returned.Could you please clarify why the return type is optional in this context? Is there a scenario where this method might return
nil
that I might have missed?