Skip to content

Commit

Permalink
Async Lifecycle (#781)
Browse files Browse the repository at this point in the history
* Drop support for 5.8

* Adopt new APIs
  • Loading branch information
0xTim authored Oct 6, 2024
1 parent dfcbeba commit 223b27d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 49 deletions.
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
}
}

0 comments on commit 223b27d

Please sign in to comment.