提交 5b14d5ca 编写于 作者: J jinhai

Fix compile error

上级 25d18944
......@@ -9,7 +9,7 @@ class VectorEngine(object):
@staticmethod
def AddGroup(group_id):
group = GroupTable.query.filter(GroupTable.group_name==group_id).first()
if(group):
if group:
return jsonify({'code': 1, 'group_name': group_id, 'file_number': group.file_number})
else:
new_group = GroupTable(group_id)
......@@ -20,7 +20,7 @@ class VectorEngine(object):
@staticmethod
def GetGroup(group_id):
group = GroupTable.query.filter(GroupTable.group_name==group_id).first()
if(group):
if group:
return jsonify({'code': 0, 'group_name': group_id, 'file_number': group.file_number})
else:
return jsonify({'code': 1, 'group_name': group_id, 'file_number': 0}) # not found
......@@ -53,9 +53,9 @@ class VectorEngine(object):
@staticmethod
def AddVector(group_id, vector):
print(group_id, vector)
file = FileTable.query.filter(and_(FileTable.group_name == group_id, FileTable.type == 'raw').first()
if (file):
if(file.row_number >= ROW_LIMIT):
file = FileTable.query.filter(and_(FileTable.group_name == group_id, FileTable.type == 'raw')).first()
if file:
if file.row_number >= ROW_LIMIT:
# create index
index_filename = file.filename + "_index"
CreateIndex(group_id, index_filename)
......@@ -103,4 +103,4 @@ class VectorEngine(object):
@staticmethod
def InsertVectorIntoRawFile(filename, vector):
print(sys._getframe().f_code.co_name)
return filename
\ No newline at end of file
return filename
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册