mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Run the data scanner routine in a loop (#13928)
After the introduction of Refresh logic in locks, the data scanner can quit when the data scanner lock is not able to get refreshed. In that case, the context of the data scanner will get canceled and runDataScanner() will quit. Another server would pick the scanning routine but after some time, all nodes can just have all scanning routine aborted, as described above. This fix will just run the data scanner in a loop.
This commit is contained in:
parent
111c6177d2
commit
926373f9c1
@ -71,7 +71,17 @@ var (
|
|||||||
|
|
||||||
// initDataScanner will start the scanner in the background.
|
// initDataScanner will start the scanner in the background.
|
||||||
func initDataScanner(ctx context.Context, objAPI ObjectLayer) {
|
func initDataScanner(ctx context.Context, objAPI ObjectLayer) {
|
||||||
go runDataScanner(ctx, objAPI)
|
go func() {
|
||||||
|
// Run the data scanner in a loop
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
runDataScanner(ctx, objAPI)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
type safeDuration struct {
|
type safeDuration struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user