mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-12 13:50:59 +00:00
fix: ensure File.status is set correctly after storing data to avoid null values
This commit is contained in:
@@ -318,12 +318,12 @@ class RAGManager:
|
|||||||
self.ap.logger.error(f'Knowledge Base with UUID {knowledge_base_uuid} not found.')
|
self.ap.logger.error(f'Knowledge Base with UUID {knowledge_base_uuid} not found.')
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.ap.storage_mgr.storage_provider.exists(file_id):
|
if not await self.ap.storage_mgr.storage_provider.exists(file_id):
|
||||||
self.ap.logger.error(f'File with ID {file_id} does not exist.')
|
self.ap.logger.error(f'File with ID {file_id} does not exist.')
|
||||||
return
|
return
|
||||||
self.ap.logger.info(f'File with ID {file_id} exists, proceeding with association.')
|
self.ap.logger.info(f'File with ID {file_id} exists, proceeding with association.')
|
||||||
# add new file record
|
# add new file record
|
||||||
file_to_update = File(id=file_id, kb_id=kb.id)
|
file_to_update = File(id=file_id, kb_id=kb.id, file_name=file_id, path=os.path.join('data', 'storage', file_id), file_type=os.path.splitext(file_id)[1].lstrip('.'), status=0)
|
||||||
session.add(file_to_update)
|
session.add(file_to_update)
|
||||||
session.commit()
|
session.commit()
|
||||||
self.ap.logger.info(
|
self.ap.logger.info(
|
||||||
|
|||||||
Reference in New Issue
Block a user