Skip to content

Commit

Permalink
fix make check
Browse files Browse the repository at this point in the history
  • Loading branch information
amyangfei committed Apr 20, 2020
1 parent 47456de commit 8c35de8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cdc/puller/file_sorter.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ func newFileCache() *fileCache {
}

func (cache *fileCache) resetUnsortedFiles() {
for _, f := range cache.unsortedFiles {
cache.toRemoveFiles = append(cache.toRemoveFiles, f)
}
cache.toRemoveFiles = append(cache.toRemoveFiles, cache.unsortedFiles...)
cache.unsortedFiles = make([]string, 0, defaultInitFileCount)
cache.availableFileIdx = make([]int, 0, defaultInitFileCount)
cache.availableFileSize = make(map[int]uint64, defaultInitFileCount)
Expand Down Expand Up @@ -392,9 +390,7 @@ func (fs *FileSorter) rotate(ctx context.Context, resolvedTs uint64) error {

fs.cache.fileLock.Lock()
atomic.StoreInt32(&fs.cache.sorting, 0)
for _, f := range toRemoveFiles {
fs.cache.toRemoveFiles = append(fs.cache.toRemoveFiles, f)
}
fs.cache.toRemoveFiles = append(fs.cache.toRemoveFiles, toRemoveFiles...)
fs.cache.fileLock.Unlock()
fs.output(ctx, model.NewResolvedPolymorphicEvent(resolvedTs))

Expand Down

0 comments on commit 8c35de8

Please sign in to comment.