diff --git a/.gitignore b/.gitignore index d8cdac7..acb159a 100755 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ DerivedData/ .topics mqtt_password.txt .env +.smbdelete* diff --git a/Makefile b/Makefile index 3fd85e4..38b891f 100755 --- a/Makefile +++ b/Makefile @@ -10,6 +10,9 @@ bootstrap: bootstrap-env bootstrap-topics build: @swift build +clean: + rm -rf .build + run: @swift run dewPoint-controller @@ -22,3 +25,4 @@ stop-mosquitto: test-docker: @docker-compose run -i test @docker-compose kill mosquitto-test + @docker-compose rm -f diff --git a/Sources/ClientLive/Live.swift b/Sources/ClientLive/Live.swift index 573cc85..5e8b698 100755 --- a/Sources/ClientLive/Live.swift +++ b/Sources/ClientLive/Live.swift @@ -41,11 +41,10 @@ extension Client { } import Logging -import NIOTransportServices import EnvVars public class AsyncClient { - //public static let eventLoopGroup = NIOTSEventLoopGroup() + public static let eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1) public let client: MQTTClient public private(set) var shuttingDown: Bool diff --git a/Sources/dewPoint-controller/main.swift b/Sources/dewPoint-controller/main.swift index 06a5e4d..2e0d12f 100755 --- a/Sources/dewPoint-controller/main.swift +++ b/Sources/dewPoint-controller/main.swift @@ -21,6 +21,7 @@ var environment = try bootstrap(eventLoopGroup: eventLoopGroup, logger: logger, // Set the log level to info only in production mode. if environment.envVars.appEnv == .production { + logger.debug("Updating logging level to info.") logger.logLevel = .info } @@ -43,7 +44,7 @@ while true { try client.subscribe().wait() Thread.sleep(forTimeInterval: 1) } - + // Check if sensors need processed. if state.sensors.needsProcessed { logger.debug("Sensor state has changed...") @@ -68,6 +69,6 @@ while true { // logger.debug("Fetching dew point...") // // logger.debug("Published dew point...") - + Thread.sleep(forTimeInterval: 5) } diff --git a/buildServer.json b/buildServer.json new file mode 100755 index 0000000..1e44c41 --- /dev/null +++ b/buildServer.json @@ -0,0 +1,19 @@ +{ + "name": "xcode build server", + "version": "0.2", + "bspVersion": "2.0", + "languages": [ + "c", + "cpp", + "objective-c", + "objective-cpp", + "swift" + ], + "argv": [ + "/opt/homebrew/bin/xcode-build-server" + ], + "workspace": "/Volumes/michael/Repos/github.com/hvac-iot/swift-mqtt-dewPoint/.swiftpm/xcode/package.xcworkspace", + "build_root": "/Volumes/michael/Repos/github.com", + "scheme": "dewPoint-controller-Package", + "kind": "xcode" +} \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 54ff6a2..f2edbad 100755 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,4 +1,4 @@ -# run this with docker-compose -f docker/docker-compose.yml run test +# run this with docker-compose run test services: server: image: swift-mqtt-dewpoint:latest @@ -6,7 +6,7 @@ services: env_file: .env test: - image: swift:latest + image: swift:5.10 #build: #context: ./ platform: linux/amd64