Skip to content

Commit 7a27642

Browse files
committed
🚧 fix(wip): add milvus auth
1 parent ad166af commit 7a27642

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

magnet/utils/milvus.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ def on(self):
4141
4242
"""
4343
try:
44-
self.connection = connections.connect(host=self.config['MILVUS_URI'], port=self.config['MILVUS_PORT'])
44+
self.connection = connections.connect(
45+
host=self.config['MILVUS_URI']
46+
, port=self.config['MILVUS_PORT']
47+
, user=self.config['MILVUS_USER']
48+
, password=self.config['MILVUS_PASSWORD']
49+
) \
50+
if 'MILVUS_PASSWORD' in self.config and 'MILVUS_USER' in self.config \
51+
else connections.connect(host=self.config['MILVUS_URI'], port=self.config['MILVUS_PORT'])
4552
self.collection = Collection(name=self.config['INDEX'], schema=self.schema)
4653
_f('success', f"connected successfully to {self.config['MILVUS_URI']}")
4754
except Exception as e:

0 commit comments

Comments
 (0)