diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index 8e76357f7..342d4a03a 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -135,8 +135,7 @@ func main() { officeGroup.POST("/send_msg_to_tag", office.SendMsg2Tag) officeGroup.POST("/get_send_tag_log", office.GetTagSendLogs) } - apiThird.MinioInit() - log.Info("", "MinioInit fin") + go apiThird.MinioInit() ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port") flag.Parse() r.Run(":" + strconv.Itoa(*ginPort)) diff --git a/internal/api/third/minio_init.go b/internal/api/third/minio_init.go index 209da863f..23ad88405 100644 --- a/internal/api/third/minio_init.go +++ b/internal/api/third/minio_init.go @@ -38,10 +38,10 @@ func MinioInit() { } err = minioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.Bucket, opt) if err != nil { - log.NewInfo(operationID, utils.GetSelfFuncName(), err.Error()) + log.NewError(operationID, utils.GetSelfFuncName(), "MakeBucket failed ", err.Error()) exists, err := minioClient.BucketExists(context.Background(), config.Config.Credential.Minio.Bucket) if err == nil && exists { - log.NewInfo(operationID, utils.GetSelfFuncName(), "We already own %s\n", config.Config.Credential.Minio.Bucket) + log.NewWarn(operationID, utils.GetSelfFuncName(), "We already own ", config.Config.Credential.Minio.Bucket) } else { if err != nil { log.NewError(operationID, utils.GetSelfFuncName(), err.Error())