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';
from sqlalchemy import Column, Integer, BigInteger, String
from sqlalchemy.orm import declarative_base
Base = declarative_base()
package com.shop.inventory;
import jakarta.persistence.*;
@Entity
@Table(name = "inventory_item")
CREATE TABLE outbox_deliveries (
id BIGSERIAL PRIMARY KEY,
dedupe_key TEXT NOT NULL,
target_url TEXT NOT NULL,
payload JSONB NOT NULL,
status TEXT NOT NULL DEFAULT 'PENDING',
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;
const DEFAULTS = {
baseDelay: 300,
maxDelay: 8000,
factor: 2,
jitter: 0.5,
};
<?php
namespace App\Message;
final class SyncCustomerMessage
{