Skip to content

Commit

Permalink
Add proper comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pixincreate committed Dec 23, 2023
1 parent 511fdd4 commit 9eb8bb3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/router/src/core/payments/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,14 +987,16 @@ where
match schedule_time {
Some(stime) => {
if !requeue {
metrics::TASKS_ADDED_COUNT.add(&metrics::CONTEXT, 1, &[]); // Metrics
// Increment the count of added tasks every time a payment has been confirmed or PSync has been called
metrics::TASKS_ADDED_COUNT.add(&metrics::CONTEXT, 1, &[]);
super::add_process_sync_task(&*state.store, payment_attempt, stime)
.await
.into_report()
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Failed while adding task to process tracker")
} else {
metrics::TASKS_RESET_COUNT.add(&metrics::CONTEXT, 1, &[]); // Metrics
// When the requeue is true, we reset the tasks count as we reset the task every time it is requeued
metrics::TASKS_RESET_COUNT.add(&metrics::CONTEXT, 1, &[]);
super::reset_process_sync_task(&*state.store, payment_attempt, stime)
.await
.into_report()
Expand Down

0 comments on commit 9eb8bb3

Please sign in to comment.