Skip to content

Commit

Permalink
Allow to clear errors using env var MORPH_CLEAR_ERROR=clear
Browse files Browse the repository at this point in the history
  • Loading branch information
kremio committed Nov 26, 2018
1 parent df5f11f commit 28d90d3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pipeline.js
Expand Up @@ -37,9 +37,12 @@ const pipeline = async () => getDB( path.resolve('./config/database.json'), fals
})
}

//Check if they are any error from which to start from
const error = await errorTable.get( dbHandle )
//Consume the error
let error
if( !process.env.MORPH_CLEAR_ERROR || process.env.MORPH_CLEAR_ERROR != 'clear' ){
//Check if they are any error from which to start from
error = await errorTable.get( dbHandle )
}
//Consume all errors
await errorTable.clear( dbHandle )
if(!error){
return scraperOptions
Expand Down

0 comments on commit 28d90d3

Please sign in to comment.