Skip to content

Commit

Permalink
Merge pull request #1071 from alpaker/tunable-log-rotate-check
Browse files Browse the repository at this point in the history
nsq_to_file: new flag -rotate-check-interval
  • Loading branch information
mreiferson authored Aug 20, 2018
2 parents d22e9cf + e475aaf commit 4585cdd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/nsq_to_file/file_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (f *FileLogger) router(r *nsq.Consumer) {
pos := 0
output := make([]*nsq.Message, *maxInFlight)
sync := false
ticker := time.NewTicker(time.Duration(30) * time.Second)
ticker := time.NewTicker(*rotateCheckInterval)
closing := false
closeFile := false
exit := false
Expand Down
1 change: 1 addition & 0 deletions apps/nsq_to_file/nsq_to_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var (

rotateSize = flag.Int64("rotate-size", 0, "rotate the file when it grows bigger than `rotate-size` bytes")
rotateInterval = flag.Duration("rotate-interval", 0*time.Second, "rotate the file every duration")
rotateCheckInterval = flag.Duration("rotate-check-interval", 30*time.Second, "check whether the file should be rotated every duration")

httpConnectTimeout = flag.Duration("http-client-connect-timeout", 2*time.Second, "timeout for HTTP connect")
httpRequestTimeout = flag.Duration("http-client-request-timeout", 5*time.Second, "timeout for HTTP request")
Expand Down

0 comments on commit 4585cdd

Please sign in to comment.