export interface RetryOptions {
retries: number;
baseMs: number;
maxMs: number;
signal?: AbortSignal;
onRetry?: (attempt: number, delay: number, err: unknown) => void;
class AddUniqueIndexToTags < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def up
execute <<~SQL
UPDATE tags SET name = LOWER(TRIM(name)) WHERE name IS NOT NULL;
package retry
import (
"context"
"net/http"
"strconv"
module RetryableTransaction
module_function
RETRIABLE = [ActiveRecord::Deadlocked, ActiveRecord::LockWaitTimeout].freeze
def run(max_retries: 3, base_delay: 0.05, &block)
import { readFileSync } from 'fs';
import { join } from 'path';
import Handlebars from 'handlebars';
import mjml2html from 'mjml';
import { htmlToText } from 'html-to-text';
import { ApplicationConfig } from '@angular/core';
import {
provideHttpClient,
withInterceptors,
} from '@angular/common/http';
import { retryInterceptor } from './retry.interceptor';
package com.shop.inventory;
import jakarta.persistence.*;
@Entity
@Table(name = "inventory_item")
package com.example.rates.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.web.client.RestTemplate;
export class TimeoutError extends Error {
constructor(public readonly ms: number) {
super(`Request timed out after ${ms}ms`);
this.name = "TimeoutError";
}
}
package httpretry
import (
"math/rand"
"time"
)
package retry
import (
"context"
"math/rand"
"time"
package bank
import "errors"
var ErrVersionConflict = errors.New("optimistic lock: version conflict")
var ErrInsufficientFunds = errors.New("insufficient funds")