mirror of
https://github.com/minio/minio.git
synced 2026-02-11 05:10:16 -05:00
Cleanup and make a safer code (#5794)
This commit is contained in:
committed by
kannappanr
parent
76cc65531c
commit
954142a98f
@@ -102,7 +102,14 @@ func (s *adminCmd) ListLocks(query *ListLocksQuery, reply *ListLocksReply) error
|
||||
if err := query.IsAuthenticated(); err != nil {
|
||||
return err
|
||||
}
|
||||
volLocks := listLocksInfo(query.Bucket, query.Prefix, query.Duration)
|
||||
objectAPI := newObjectLayerFn()
|
||||
if objectAPI == nil {
|
||||
return errServerNotInitialized
|
||||
}
|
||||
volLocks, err := objectAPI.ListLocks(context.Background(), query.Bucket, query.Prefix, query.Duration)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*reply = ListLocksReply{VolLocks: volLocks}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user