Skip to content

Commit 45f799f

Browse files
authored
Merge pull request #36 from Automattic/increase-time-out
Increase S3 client timeout to 2 hours
2 parents 6e9bd3a + 5e44442 commit 45f799f

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

Sources/hostmgr/helpers/Logging.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import Foundation
12
import Logging
23

34
var logger = Logger(label: "com.automattic.hostmgr")
45

56
func initializeLoggingSystem() {
6-
logger.logLevel = .trace
7+
let logLevelFromEnv = ProcessInfo.processInfo.environment["LOG_LEVEL"].flatMap { Logger.Level(rawValue: $0) }
8+
logger.logLevel = logLevelFromEnv ?? .info
79
LoggingSystem.bootstrap { label in
810
MultiplexLogHandler([
911
StreamLogHandler.standardError(label: label)

Sources/hostmgr/helpers/S3.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct S3Manager {
125125
for bucket: String,
126126
in region: Region
127127
) throws -> S3 {
128-
let timeout = TimeAmount.minutes(30)
128+
let timeout = TimeAmount.hours(2)
129129
let s3Client = S3(client: aws, region: region, timeout: timeout)
130130

131131
guard Configuration.shared.allowAWSAcceleratedTransfer else {

Sources/hostmgr/main.swift

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import libhostmgr
55

66
struct Hostmgr: ParsableCommand {
77

8-
private var appVersion = "0.14.1"
8+
private static var appVersion = "0.14.2"
99

1010
static var configuration = CommandConfiguration(
1111
abstract: "A utility for managing VM hosts",
12+
version: appVersion,
1213
subcommands: [
1314
VMCommand.self,
1415
SyncCommand.self,
@@ -18,25 +19,6 @@ struct Hostmgr: ParsableCommand {
1819
BenchmarkCommand.self,
1920
ConfigCommand.self
2021
])
21-
22-
@Flag(help: "Print the version and exit")
23-
var version: Bool = false
24-
25-
func run() throws {
26-
guard version == false else {
27-
print(appVersion)
28-
return
29-
}
30-
31-
logger.debug("Starting Up")
32-
33-
guard Configuration.isValid else {
34-
print("Invalid configuration – exiting")
35-
throw ExitCode(1)
36-
}
37-
38-
throw CleanExit.helpRequest(self)
39-
}
4022
}
4123

4224
initializeLoggingSystem()

0 commit comments

Comments
 (0)