summaryrefslogtreecommitdiff
path: root/internal/io/fs/readfile_processor_optimized.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-10 19:37:21 +0200
committerPaul Buetow <paul@buetow.org>2026-03-10 19:37:21 +0200
commitf6e23930da2900c43a5389a2e7d1e38d8221a76f (patch)
tree3352cc0d8c0819d5cc58fdf987ed39f87a30a34b /internal/io/fs/readfile_processor_optimized.go
parent1fc24f9affed5128702e4de80572cac8c82d399e (diff)
Refactor server-side config singleton reads
Diffstat (limited to 'internal/io/fs/readfile_processor_optimized.go')
-rw-r--r--internal/io/fs/readfile_processor_optimized.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/io/fs/readfile_processor_optimized.go b/internal/io/fs/readfile_processor_optimized.go
index 6447f89..2e880e7 100644
--- a/internal/io/fs/readfile_processor_optimized.go
+++ b/internal/io/fs/readfile_processor_optimized.go
@@ -8,7 +8,6 @@ import (
"os"
"time"
- "github.com/mimecast/dtail/internal/config"
"github.com/mimecast/dtail/internal/io/dlog"
"github.com/mimecast/dtail/internal/io/line"
"github.com/mimecast/dtail/internal/io/pool"
@@ -106,7 +105,7 @@ func (f *readFile) scanLinesPreserveEndings(data []byte, atEOF bool) (advance in
return 0, nil, nil
}
- maxLineLen := config.Server.MaxLineLength
+ maxLineLen := f.lineLimit()
// Look for a newline
if i := bytes.IndexByte(data, '\n'); i >= 0 {
@@ -154,7 +153,7 @@ func (f *readFile) scanLinesWithMaxLength(data []byte, atEOF bool) (advance int,
return 0, nil, nil
}
- maxLineLen := config.Server.MaxLineLength
+ maxLineLen := f.lineLimit()
// Look for a newline
if i := bytes.IndexByte(data, '\n'); i >= 0 {
@@ -312,7 +311,7 @@ func (f *readFile) tailWithProcessorOptimized(ctx context.Context, fd *os.File,
partialLine.Write(data)
// Check if line is too long
- if partialLine.Len() >= config.Server.MaxLineLength {
+ if partialLine.Len() >= f.lineLimit() {
if !f.warnedAboutLongLine {
f.serverMessages <- dlog.Common.Warn(f.filePath,
"Long log line, splitting into multiple lines") + "\n"