Skip to content

Commit

Permalink
skip existed file
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrust committed May 9, 2024
1 parent 5e8b966 commit 798e957
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/es-node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func EsNodeInit(ctx *cli.Context) error {
return err
}
if diff != nil && diff.Cmp(big.NewInt(0)) == 0 {
return fmt.Errorf("Shard not exist: %d", shard)
return fmt.Errorf("shard not exist: %d", shard)
}
}
shardIdxList = append(shardIdxList, shard)
Expand All @@ -254,7 +254,7 @@ func EsNodeInit(ctx *cli.Context) error {
return err
}
if len(shardList) == 0 {
return fmt.Errorf("No shard indexes found")
return fmt.Errorf("no shard indexes found")
}
shardIdxList = shardList
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/es-node/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ func createDataFile(cfg *storage.StorageConfig, shardIdxList []uint64, datadir s
for _, shardIdx := range shardIdxList {
dataFile := filepath.Join(datadir, fmt.Sprintf(fileName, shardIdx))
if _, err := os.Stat(dataFile); err == nil {
log.Error("Creating data file", "error", "file already exists, will not overwrite", "file", dataFile)
return nil, err
log.Info("Data file exists, skiping", "shard", shardIdx, "file", dataFile)
continue
}
if cfg.ChunkSize == 0 {
return nil, fmt.Errorf("chunk size should not be 0")
Expand Down

0 comments on commit 798e957

Please sign in to comment.