@Entity
@Table(name = "idempotency_records",
uniqueConstraints = @UniqueConstraint(columnNames = "idempotency_key"))
public class IdempotencyRecord {
public enum Status { IN_PROGRESS, COMPLETED }
package upload
import (
"errors"
"io"
"log"
package proxy
import (
"log"
"net"
"net/http"
package realtime
import (
"fmt"
"net/http"
"time"
package webhook
import (
"encoding/json"
"io"
"net/http"
import { NestFactory } from '@nestjs/core';
import { ValidationPipe } from '@nestjs/common';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const RETRYABLE_STATUS = new Set([408, 429, 500, 502, 503, 504]);
export function isRetryable(error: unknown, response?: Response): boolean {
if (response) {
return RETRYABLE_STATUS.has(response.status);
}
package httpcache
import (
"strconv"
"strings"
"time"
use dashmap::DashMap;
use std::time::Instant;
pub struct TokenBucket {
tokens: f64,
last_refill: Instant,
class ApiError extends Error {
constructor(statusCode, message, code) {
super(message);
this.name = 'ApiError';
this.statusCode = statusCode;
this.code = code || null;
package health
import (
"context"
"sync"
"time"
package logctx
import (
"context"
"log/slog"
)