Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async Lifecycle #781

Merged
merged 2 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.8
// swift-tools-version:5.9
import PackageDescription

let package = Package(
Expand All @@ -13,7 +13,7 @@ let package = Package(
.library(name: "Fluent", targets: ["Fluent"]),
],
dependencies: [
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.48.4"),
.package(url: "https://github.com/vapor/fluent-kit.git", from: "1.49.0"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.101.0"),
],
targets: [
Expand All @@ -38,6 +38,10 @@ let package = Package(
)

var swiftSettings: [SwiftSetting] { [
.enableUpcomingFeature("ExistentialAny"),
.enableUpcomingFeature("ConciseMagicFile"),
.enableUpcomingFeature("ForwardTrailingClosures"),
.enableUpcomingFeature("ImportObjcForwardDeclarations"),
.enableUpcomingFeature("DisableOutwardActorInference"),
.enableExperimentalFeature("StrictConcurrency=complete"),
] }
47 changes: 0 additions & 47 deletions [email protected]

This file was deleted.

4 changes: 4 additions & 0 deletions Sources/Fluent/FluentProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ extension Application {
func shutdown(_ application: Application) {
application.databases.shutdown()
}

func shutdownAsync(_ application: Application) async {
await application.databases.shutdownAsync()
}
}

let application: Application
Expand Down
4 changes: 4 additions & 0 deletions Tests/FluentTests/SessionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,8 @@ struct StaticDatabase: DatabaseConfiguration, DatabaseDriver {
func shutdown() {
// Do nothing.
}

func shutdownAsync() async {
// Do nothing
}
}