Added ability to store CNN models
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
from .require_decorators import json_required
|
||||
from .error_handlers import register_all_error_handlers
|
||||
from .storage import storage
|
||||
from .storage import storage, ensure_buckets
|
@ -1,3 +1,18 @@
|
||||
from flask import current_app
|
||||
from flask_minio import Minio
|
||||
from minio.error import BucketAlreadyExists, BucketAlreadyOwnedByYou
|
||||
|
||||
storage = Minio()
|
||||
storage = Minio()
|
||||
|
||||
|
||||
def ensure_buckets():
|
||||
for bucket_name in [current_app.config['MINIO_SVM_BUCKET_NAME'],
|
||||
current_app.config['MINIO_CNN_BUCKET_NAME']]:
|
||||
try:
|
||||
storage.connection.make_bucket(bucket_name)
|
||||
|
||||
except BucketAlreadyOwnedByYou:
|
||||
pass
|
||||
except BucketAlreadyExists:
|
||||
pass
|
||||
# Everything else should be raised
|
||||
|
Reference in New Issue
Block a user