Skip to content

Commit

Permalink
attempts checker for blocks tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
rcrvano committed Nov 18, 2024
1 parent a718cf0 commit 11f5805
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main/src/modules/BlockProcessor/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ export class BlocksProcessorService {
trx: Knex.Transaction,
taskRecord: ProcessingTaskModel<ENTITY>,
): Promise<{ status: boolean; callback?: any }> {
const { entity_id: blockId, collect_uid } = taskRecord
const { entity_id: blockId, collect_uid, attempts } = taskRecord

if (attempts > 10) {
this.logger.info({
event: 'BlockProcessor.processTaskMessage',
blockId,
message: `Block ${blockId} processing attempts > 10. Skip this block.`,
})

return { status: true }
}

//check that block wasn't processed already
if (await this.databaseHelper.getBlockById(blockId)) {
Expand Down

0 comments on commit 11f5805

Please sign in to comment.