diff --git a/Sources/ServiceLifecycle/GracefulShutdown.swift b/Sources/ServiceLifecycle/GracefulShutdown.swift index c8056b0..ca6488c 100644 --- a/Sources/ServiceLifecycle/GracefulShutdown.swift +++ b/Sources/ServiceLifecycle/GracefulShutdown.swift @@ -157,7 +157,12 @@ public func cancelWhenGracefulShutdown(_ operation: @Sendable @esca /// Cancels the closure when a graceful shutdown was triggered. /// /// - Parameter operation: The actual operation. +#if compiler(>=6.0) @available(*, deprecated, renamed: "cancelWhenGracefulShutdown") +#else +// renamed pattern has been shown to cause compiler crashes in 5.x compilers. +@available(*, deprecated, message: "renamed to cancelWhenGracefulShutdown") +#endif public func cancelOnGracefulShutdown(_ operation: @Sendable @escaping () async throws -> T) async rethrows -> T? { return try await cancelWhenGracefulShutdown(operation) }