Skip to content

Commit

Permalink
fix streamloader do not work (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
sollhui authored Oct 9, 2024
1 parent 62b8a1f commit 65184e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,16 @@ func paramCheck() {
}

// split header "a:b?c:d" into {a:b, c:d}
enableConcurrency = true
if header != "" {
headers = make(map[string]string)
for _, v := range strings.Split(header, "?") {
if v == "" {
continue
}
kv := strings.Split(v, ":")
if strings.ToLower(kv[0]) == "format" && strings.ToLower(kv[1]) == "csv" {
enableConcurrency = true
if strings.ToLower(kv[0]) == "format" && strings.ToLower(kv[1]) != "csv" {
enableConcurrency = false
}
if len(kv) > 2 {
headers[kv[0]] = strings.Join(kv[1:], ":")
Expand Down Expand Up @@ -308,6 +309,7 @@ func calculateAndCheckWorkers(reader *file.FileReader, size int64) {

if !enableConcurrency {
loadInfo.Workers = 1
workers = 1
return
}

Expand Down

0 comments on commit 65184e7

Please sign in to comment.