(repeater: SQLRepeater)
Worker task to send SQLRepeatRecords in chronological order.

    This function assumes that ``repeater`` checks have already
    been performed. Call via ``models.attempt_forward_now()``.
Worker task to send SQLRepeatRecords in chronological order.
Worker task to send SQLRepeatRecords in chronological order .
def process_repeater(repeater: SQLRepeater):
    """
    Worker task to send SQLRepeatRecords in chronological order.

    This function assumes that ``repeater`` checks have already
    been performed. Call via ``models.attempt_forward_now()``.
    """
    with CriticalSection(
        [f'process-repeater-{repeater.repeater_id}'],
        fail_hard=False, block=False, timeout=5 * 60 * 60,
    ):
        for repeat_record in repeater.repeat_records_ready[:RECORDS_AT_A_TIME]:
            try:
                payload = get_payload(repeater.repeater, repeat_record)
            except Exception:
                # The repeat record is cancelled if there is an error
                # getting the payload. We can safely move to the next one.
                continue
            should_retry = not send_request(repeater.repeater,
                                            repeat_record, payload)
            if should_retry:
                break
def process_repeater ( repeater : SQLRepeater ) : with CriticalSection ( [ f'process-repeater-{repeater.repeater_id}' ] , fail_hard = False , block = False , timeout = 5 * 60 * 60 , ) : for repeat_record in repeater . repeat_records_ready [ : RECORDS_AT_A_TIME ] : try : payload = get_payload ( repeater . repeater , repeat_record ) except Exception : # The repeat record is cancelled if there is an error # getting the payload. We can safely move to the next one. continue should_retry = not send_request ( repeater . repeater , repeat_record , payload ) if should_retry : break