fn drop_error(
        result: Result<(), TrySendError<ManageTimeout>>,
        channel_last_fail: Arc<Mutex<Instant>>,
    ) {
        let (reason, uuid) = match result {
            Ok(_) => return,
            Err(TrySendError::Full(mto)) => ("full", mto.uuid()),
            Err(TrySendError::Closed(mto)) => ("closed", mto.uuid()),
        };

        // By using try_lock() we avoid worsening any overload situation by limiting unnecessary
        // logging action.
        if let Ok(ref mut t0) = channel_last_fail.try_lock() {
            let t = Instant::now();
            if t.duration_since(**t0).as_secs() >= 60 {
                warn!(
                    "Time-based settlement failed temporarily \
                    (bounded channel {}) for (at least) the account {}. \
                    Service might be overloaded. Check the balances \
                    once the overload has passed.",
                    reason, uuid
                );
                **t0 = t;
            }
        }
    }
// Rationale for dropping the errors:
//
// If the channel is full of peer accounts, it is likely
// that the peer account that the messages are directed towards
// has already been scheduled for settlement.
//
// If the channel is full because the background task is
// not keeping up, bounded channel prevents an infinitely-
// growing queue from forming.
//
// If a later change introduces a bug in the background task,
// resulting in it not processing the incoming messages,
// bounded channel likewise prevents an infinitely-growing queue.
//
// If the messages are not being received because of the receiver
// having closed, the background task has exited.
// This normally happens on shutdown.
//
// Should sending through bounded channel fail (due to afore-
// mentioned reasons), the intended time-based settlements are lost
// as a result. The threshold-based settlement will, however,
// eventually take over, acting as a "backup" in this situation.
// Moreover the bounded channel failing should only happen
// under an exceptionally heavy load.
//
// While the function drops the errors, it also logs them
// once every 60 seconds. This is to prevent flooding the log
// with (identical) error messages from -- most likely --
// the very same problem.
Rationale for dropping the errors:
If the channel is full of peer accounts, it is likely
that the peer account that the messages are directed towards
has already been scheduled for settlement.

If the channel is full because the background task is
not keeping up, bounded channel prevents an infinitely
growing queue from forming.

If a later change introduces a bug in the background task,
resulting in it not processing the incoming messages,
bounded channel likewise prevents an infinitely-growing queue.

If the messages are not being received because of the receiver
having closed, the background task has exited.
This normally happens on shutdown.

Should sending through bounded channel fail (due to afore
mentioned reasons), the intended time-based settlements are lost
as a result. The threshold-based settlement will, however,
eventually take over, acting as a "backup" in this situation.
Moreover the bounded channel failing should only happen
under an exceptionally heavy load.

While the function drops the errors, it also logs them
once every 60 seconds. This is to prevent flooding the log
with (identical) error messages from -- most likely
the very same problem.
Rationale for dropping the errors : If the channel is full of peer accounts it is likely that the peer account that the messages are directed towards has already been scheduled for settlement . If the channel is full because the background task is not keeping up bounded channel prevents an infinitely growing queue from forming . If a later change introduces a bug in the background task resulting in it not processing the incoming messages bounded channel likewise prevents an infinitely - growing queue . If the messages are not being received because of the receiver having closed the background task has exited . This normally happens on shutdown . Should sending through bounded channel fail ( due to afore mentioned reasons ) the intended time - based settlements are lost as a result . The threshold - based settlement will however eventually take over acting as a " backup " in this situation . Moreover the bounded channel failing should only happen under an exceptionally heavy load . While the function drops the errors it also logs them once every 60 seconds . This is to prevent flooding the log with ( identical ) error messages from -- most likely the very same problem .
fn drop_error(
        result: Result<(), TrySendError<ManageTimeout>>,
        channel_last_fail: Arc<Mutex<Instant>>,
    ) {
        let (reason, uuid) = match result {
            Ok(_) => return,
            Err(TrySendError::Full(mto)) => ("full", mto.uuid()),
            Err(TrySendError::Closed(mto)) => ("closed", mto.uuid()),
        };
        // By using try_lock() we avoid worsening any overload situation by limiting unnecessary
        // logging action.
        if let Ok(ref mut t0) = channel_last_fail.try_lock() {
            let t = Instant::now();
            if t.duration_since(**t0).as_secs() >= 60 {
                warn!(
                    "Time-based settlement failed temporarily \
                    (bounded channel {}) for (at least) the account {}. \
                    Service might be overloaded. Check the balances \
                    once the overload has passed.",
                    reason, uuid
                );
                **t0 = t;
            }
        }
    }
fn drop_error ( result : Result < ( ) , TrySendError < ManageTimeout > > , channel_last_fail : Arc < Mutex < Instant > > , ) { let ( reason , uuid ) = match result { Ok ( _ ) => return , Err ( TrySendError :: Full ( mto ) ) => ( " " , mto . uuid ( ) ) , Err ( TrySendError :: Closed ( mto ) ) => ( " " , mto . uuid ( ) ) , } ; // By using try_lock() we avoid worsening any overload situation by limiting unnecessary // logging action. if let Ok ( ref mut t0 ) = channel_last_fail . try_lock ( ) { let t = Instant :: now ( ) ; if t . duration_since ( * * t0 ) . as_secs ( ) >= 60 { warn ! ( " \
 \
 \
 " reason uuid ) ; * * t0 = t ; } } }
Rationale for dropping the errors:
If the channel is full of peer accounts, it is likely
that the peer account that the messages are directed towards
has already been scheduled for settlement.
Rationale for dropping the errors : If the channel is full of peer accounts it is likely that the peer account that the messages are directed towards has already been scheduled for settlement .
result
Result<(), TrySendError<ManageTimeout>>
channel_last_fail
Arc<Mutex<Instant>>
result
Result<(), TrySendError<ManageTimeout>>
channel_last_fail
Arc<Mutex<Instant>>