Probleme mit Deadlocks durch Timeout im Ctx verhindern.
This commit is contained in:
parent
6dadd17a58
commit
b3367d8e5e
|
|
@ -93,7 +93,10 @@ func (f *ElioDateiFoo) ScanCsv(ctx context.Context, data chan<- CountryCsvData)
|
|||
f.mu.Lock()
|
||||
f.haveDone[v.filename] = time.Now()
|
||||
f.mu.Unlock()
|
||||
f.process(ctx, v.filename, data)
|
||||
//Max 5 Sekunden zum Abarbeiten eines Datensatzes
|
||||
tctx, cancel := context.WithTimeout(ctx, time.Second*5)
|
||||
f.process(tctx, v.filename, data)
|
||||
cancel()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue