mirror of
https://github.com/minio/minio.git
synced 2025-11-28 13:09:09 -05:00
Add madmin package context support (#9172)
This is to improve responsiveness for all admin API operations and allowing callers to cancel any on-going admin operations, if they happen to be waiting too long.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
@@ -39,7 +40,7 @@ func main() {
|
||||
|
||||
// Clear locks held on mybucket/myprefix for longer than 30s.
|
||||
olderThan := time.Duration(30 * time.Second)
|
||||
locksCleared, err := madmClnt.ClearLocks("mybucket", "myprefix", olderThan)
|
||||
locksCleared, err := madmClnt.ClearLocks(context.Background(), "mybucket", "myprefix", olderThan)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user