diff --git a/cmd/server.go b/cmd/server.go index fb4669c..4e7d2ad 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -181,6 +181,17 @@ func handleV1Seed(c echo.Context) error { var new_buckets []string for _, bucket := range documents_buckets { + exists, err := client.BucketExists(context.Background(), bucket) + if err != nil { + return c.JSON(http.StatusInternalServerError, map[string]string{ + "message": "Error during minio#BucketExists", + }) + } + + if exists { + continue + } + if err = client.MakeBucket(context.Background(), bucket, minio.MakeBucketOptions{}); err != nil { return c.JSON(http.StatusInternalServerError, map[string]string{ "message": "Error during minio#MakeBucket",