Commit 9ae7fd26 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MetadataParser: Discard duplicate tasks

parent 1c317964
...@@ -157,6 +157,8 @@ parser::Task::Status MetadataParser::run( parser::Task& task ) ...@@ -157,6 +157,8 @@ parser::Task::Status MetadataParser::run( parser::Task& task )
{ {
// Let the worker drop this duplicate task // Let the worker drop this duplicate task
task.markStepCompleted( parser::Task::ParserStep::Completed ); task.markStepCompleted( parser::Task::ParserStep::Completed );
// And remove it from DB
task.destroy( m_ml, task.id() );
return parser::Task::Status::Success; return parser::Task::Status::Success;
} }
......
...@@ -128,6 +128,11 @@ bool Task::updateFileId() ...@@ -128,6 +128,11 @@ bool Task::updateFileId()
return true; return true;
} }
int64_t Task::id() const
{
return m_id;
}
bool Task::restoreLinkedEntities( ) bool Task::restoreLinkedEntities( )
{ {
auto fsFactory = m_ml->fsFactoryForMrl( mrl ); auto fsFactory = m_ml->fsFactoryForMrl( mrl );
......
...@@ -120,6 +120,7 @@ public: ...@@ -120,6 +120,7 @@ public:
void startParserStep(); void startParserStep();
bool updateFileId(); bool updateFileId();
int64_t id() const;
// Restore attached entities such as media/files // Restore attached entities such as media/files
bool restoreLinkedEntities(); bool restoreLinkedEntities();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment