diff --git a/libsearch/index/ai-indexer.cpp b/libsearch/index/ai-indexer.cpp index cd6056a..a409c18 100644 --- a/libsearch/index/ai-indexer.cpp +++ b/libsearch/index/ai-indexer.cpp @@ -121,6 +121,7 @@ bool AiIndexer::addImageFileIndex(const QJsonArray &object) bool AiIndexer::deleteFileIndex(const QStringList &files) { if(!AiIndexerPrivate::m_sessionValid) { + qWarning() << "deleteFileIndex: Session is not valid"; return false; } QJsonArray tmpArray; @@ -130,8 +131,13 @@ bool AiIndexer::deleteFileIndex(const QStringList &files) oneFile.insert(QStringLiteral("filepath"), file); tmpArray.append(oneFile); } - - return data_management_delete_files(AiIndexerPrivate::m_session, QJsonDocument(tmpArray).toJson().data()) == DataManagementResult::DATA_MANAGEMENT_SUCCESS; + DataManagementResult result = data_management_delete_files(AiIndexerPrivate::m_session, QJsonDocument(tmpArray).toJson().data()); + if(result != DataManagementResult::DATA_MANAGEMENT_SUCCESS) { + qWarning() << "Fail to call data_management_delete_files, input: " << QJsonDocument(tmpArray).toJson().data() + << "result:" << result; + return false; + } + return true; } bool AiIndexer::getAllIndexedFiles(QJsonObject &object) diff --git a/libsearch/index/index-scheduler.cpp b/libsearch/index/index-scheduler.cpp index 5e8b483..5837e66 100644 --- a/libsearch/index/index-scheduler.cpp +++ b/libsearch/index/index-scheduler.cpp @@ -107,7 +107,7 @@ void IndexScheduler::addNewPath(const QString &folders, const QStringList &black void IndexScheduler::removeIndex(const QString &folders) { - if(m_indexStop.LOAD && m_contentIndexStop.LOAD && m_ocrContentIndexStop.LOAD) { + if(m_indexStop.LOAD && m_contentIndexStop.LOAD && m_ocrContentIndexStop.LOAD && m_aiIndexStop.LOAD) { qDebug() << "Index Scheduler is being stopped, remove operation will be executed when started up next time."; return; }