aboutsummaryrefslogtreecommitdiff
path: root/internal/monitor/monitor.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/monitor/monitor.go')
-rw-r--r--internal/monitor/monitor.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/monitor/monitor.go b/internal/monitor/monitor.go
index ffe7f75..1f068b2 100644
--- a/internal/monitor/monitor.go
+++ b/internal/monitor/monitor.go
@@ -18,6 +18,7 @@ import (
"net/http"
"os"
"sync"
+ "time"
ct "github.com/google/certificate-transparency-go"
"github.com/google/certificate-transparency-go/client"
@@ -68,6 +69,8 @@ type Config struct {
Logger *logger.Logger // Debug prints only (no output by default)
Contact string // Something that help log operators get in touch
ChunkSize uint // Min number of leaves to propagate a chunk without matches
+ ChunkTime time.Duration // But always send chunks (if there are any) with this interval
+ ExitTime time.Duration // Maximum amount of time to spend on a graceful exit
BatchSize uint // Max number of certificates to accept per worker
NumWorkers uint // Number of parallel workers to use for each log
}
@@ -94,6 +97,12 @@ func New(cfg Config, evCh chan Event, cfgCh chan MonitoredLog, errCh chan error)
if cfg.ChunkSize == 0 {
cfg.ChunkSize = 4096
}
+ if cfg.ChunkTime == 0 {
+ cfg.ChunkTime = 10 * time.Minute
+ }
+ if cfg.ExitTime == 0 {
+ cfg.ExitTime = 10 * time.Second
+ }
if cfg.BatchSize == 0 {
cfg.BatchSize = 1024
}