From 52da100688b9f17d1d0b0ed5a25cbcbed5287d5b Mon Sep 17 00:00:00 2001 From: "Dr. Michael Lauer" Date: Tue, 22 Oct 2024 13:36:21 +0200 Subject: [PATCH] Threading: Get rid of the 10 seconds timer spamming the log. --- Sources/CornucopiaCore/Threading/RunLoopThread.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/CornucopiaCore/Threading/RunLoopThread.swift b/Sources/CornucopiaCore/Threading/RunLoopThread.swift index 4e99701..859a4ef 100644 --- a/Sources/CornucopiaCore/Threading/RunLoopThread.swift +++ b/Sources/CornucopiaCore/Threading/RunLoopThread.swift @@ -28,8 +28,8 @@ public extension Cornucopia.Core { assert(self == Thread.current) self.loop = RunLoop.current assert(self.loop != RunLoop.main) - - self.timer = .init(timeInterval: 10.0, target: self, selector: #selector(self.onTimerFired), userInfo: nil, repeats: true) + // We're scheduling a timer that will never fire, since runloops without at least a single source immediately return from `CFRunLoopRun()` + self.timer = .init(timeInterval: 864000, target: self, selector: #selector(self.onTimerFired), userInfo: nil, repeats: false) self.loop.add(self.timer, forMode: RunLoop.Mode.common) logger.trace("Entering runloop")