Skip to content

Commit

Permalink
Cannot re-initialize 'in-place' if set to TRIM_HORIZON.
Browse files Browse the repository at this point in the history
  • Loading branch information
gamolina committed Mar 26, 2023
1 parent 57c779b commit 398830e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions quanta-kinesis-consumer/quanta-kinesis-consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ func main() {
} else {
u.Warnf("Received Cancellation.")
}
if main.InitialPos == "TRIM_HORIZON" {
u.Error("can't re-initialize 'in-place' if set to TRIM_HORIZON, exiting")
os.Exit(1)
}
u.Warnf("Re-initializing.")
if main.ShardCount, err = main.Init(); err != nil {
u.Errorf("initialization error: %v", err)
Expand Down Expand Up @@ -418,10 +422,6 @@ func (m *Main) recoverInflight(recoverFunc func(unflushedCh chan *shared.BatchBu

func (m *Main) schemaChangeListener(e shared.SchemaChangeEvent) {

if m.InitialPos == "TRIM_HORIZON" {
u.Error("can't re-initialize on schema change if set to TRIM_HORIZON, exiting")
os.Exit(1)
}
time.Sleep(time.Second * 2)
if m.cancelFunc != nil {
m.cancelFunc()
Expand Down

0 comments on commit 398830e

Please sign in to comment.