Skip to content

Commit 6ac083a

Browse files
author
Andrea Scuderi
committed
Fix Unstable Tests
1 parent 1ed45af commit 6ac083a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Add the dependency `BreezeLambdaDynamoDBAPI` to a package:
1313

1414
```swift
15-
// swift-tools-version:5.7
15+
// swift-tools-version:6.1
1616
// The swift-tools-version declares the minimum version of Swift required to build this package.
1717

1818
import PackageDescription

Sources/BreezeDynamoDBService/BreezeDynamoDBService.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,19 @@ public actor BreezeDynamoDBService: BreezeDynamoDBServing {
8989
/// - Important: This method must be called at leat once to ensure that resources are released properly. If the method is not called, it will lead to a crash.
9090
public func gracefulShutdown() throws {
9191
guard !isShutdown else { return }
92+
isShutdown = true
9293
logger.info("Stopping DynamoDBService...")
9394
try awsClient.syncShutdown()
9495
logger.info("DynamoDBService is stopped.")
9596
logger.info("Stopping HTTPClient...")
9697
try httpClient.syncShutdown()
9798
logger.info("HTTPClient is stopped.")
98-
isShutdown = true
99+
}
100+
101+
deinit {
102+
guard !isShutdown else { return }
103+
try? awsClient.syncShutdown()
104+
try? httpClient.syncShutdown()
99105
}
100106
}
101107

0 commit comments

Comments
 (0)