@@ -33,20 +33,23 @@ extension LogstashLogHandler {
3333 /// for a short amount of time (the time it takes to duplicate this bytebuffer). Then, the "original"
3434 /// stored log data `ByteBuffer` is freed and the lock is lifted
3535 static func uploadLogData( _ task: RepeatedTask ? = nil ) { // swiftlint:disable:this cyclomatic_complexity function_body_length
36- guard let _ = Self . byteBuffer,
37- let _ = Self . totalByteBufferSize,
38- let maximumTotalLogStorageSize = Self . maximumTotalLogStorageSize,
39- let eventLoopGroup = Self . eventLoopGroup,
40- let httpClient = Self . httpClient,
41- let hostname = Self . hostname,
42- let port = Self . port else {
36+ guard let _ = Self . byteBuffer else {
4337 fatalError ( Error . notYetSetup. rawValue)
4438 }
4539
4640 guard Self . byteBuffer? . readableBytes != 0 else {
4741 return
4842 }
4943
44+ guard let _ = Self . totalByteBufferSize,
45+ let maximumTotalLogStorageSize = Self . maximumTotalLogStorageSize,
46+ let eventLoopGroup = Self . eventLoopGroup,
47+ let httpClient = Self . httpClient,
48+ let hostname = Self . hostname,
49+ let port = Self . port else {
50+ fatalError ( Error . notYetSetup. rawValue)
51+ }
52+
5053 // If total byte buffer size is exceeded, wait until the size is decreased again
5154 if totalByteBufferSize! + Self. byteBuffer!. capacity > maximumTotalLogStorageSize {
5255 Self . semaphoreCounter -= 1
0 commit comments