fix periodic checkpoint not triggered

when initialized, largestPair is empty and IsLessThan always return
false
This commit is contained in:
Tony Wang 2018-11-09 15:08:47 +08:00
parent 33d58bc6e0
commit 2f722d9cd2
No known key found for this signature in database
GPG key ID: 624D973D837983DF

View file

@ -29,7 +29,7 @@ func (srp *sampleRecordProcessor) Initialize(shardID string, checkpointer kcl.Ch
} }
func (srp *sampleRecordProcessor) shouldUpdateSequence(pair kcl.SequencePair) bool { func (srp *sampleRecordProcessor) shouldUpdateSequence(pair kcl.SequencePair) bool {
return srp.largestPair.IsLessThan(pair) return srp.largestPair.IsNil() || srp.largestPair.IsLessThan(pair)
} }
func (srp *sampleRecordProcessor) ProcessRecords(records []kcl.Record) error { func (srp *sampleRecordProcessor) ProcessRecords(records []kcl.Record) error {