This commit is contained in:
@@ -9,7 +9,7 @@ from bson import ObjectId
|
||||
from dotenv import load_dotenv
|
||||
from pymongo.collection import Collection
|
||||
|
||||
from shared.datastore import connect_minio, put_image
|
||||
from shared.datastore import Datastore
|
||||
from shared.mongodb import connect_mongodb
|
||||
from shared.mongodb.src.classes import VisualCommunication
|
||||
from shared.utils import check_env, setup_logging
|
||||
@@ -81,7 +81,9 @@ if __name__ == '__main__':
|
||||
# setup logging
|
||||
setup_logging()
|
||||
# connect to minIO
|
||||
minio_client = connect_minio()
|
||||
datastore = Datastore()
|
||||
datastore.connect()
|
||||
assert datastore._client is not None
|
||||
# connect to MongoDB
|
||||
collection, db, client = connect_mongodb()
|
||||
# list documents in mongoDB
|
||||
@@ -97,11 +99,10 @@ if __name__ == '__main__':
|
||||
try:
|
||||
# get image
|
||||
image = vis_com.get_image(
|
||||
minio_client=minio_client,
|
||||
minio_client=datastore._client,
|
||||
)
|
||||
# put buffer in minio
|
||||
object_name = put_image(
|
||||
client=minio_client,
|
||||
object_name = datastore.put_image(
|
||||
image=image,
|
||||
)
|
||||
except Exception as exc:
|
||||
|
||||
Reference in New Issue
Block a user