From cf5d22abff6596fec6cb0ca0d569d4605e0b2ea1 Mon Sep 17 00:00:00 2001 From: Emanuel Ramos <40024962+imaramos@users.noreply.github.com> Date: Fri, 13 Jul 2018 15:26:21 +0100 Subject: [PATCH] Adding Option func to set maxInterval (#60) --- checkpoint/postgres/postgres.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/checkpoint/postgres/postgres.go b/checkpoint/postgres/postgres.go index b45d673..a26c58f 100644 --- a/checkpoint/postgres/postgres.go +++ b/checkpoint/postgres/postgres.go @@ -29,6 +29,13 @@ type key struct { // Option is used to override defaults when creating a new Checkpoint type Option func(*Checkpoint) +// WithMaxInterval sets the flush interval +func WithMaxInterval(maxInterval time.Duration) Option { + return func(c *Checkpoint) { + c.maxInterval = maxInterval + } +} + // Checkpoint stores and retreives the last evaluated key from a DDB scan type Checkpoint struct { appName string