mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
fix: minio auto make bucket
This commit is contained in:
parent
ce33b79915
commit
81bcd86304
@ -40,6 +40,15 @@ func NewMinio() (s3.Interface, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
exists, err := client.BucketExists(context.Background(), conf.Bucket)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
if err := client.MakeBucket(context.Background(), conf.Bucket, minio.MakeBucketOptions{}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return &Minio{
|
||||
bucket: conf.Bucket,
|
||||
bucketURL: conf.Endpoint + "/" + conf.Bucket + "/",
|
||||
|
Loading…
x
Reference in New Issue
Block a user