Skip to content

Instantly share code, notes, and snippets.

View scorsi's full-sized avatar
😬
What if... hugh.. whatever

Sylvain Corsini scorsi

😬
What if... hugh.. whatever
  • Asobo Studio
  • France, Lille
  • 10:13 (UTC +02:00)
View GitHub Profile
@dinvlad
dinvlad / retries.ts
Last active February 2, 2024 16:18
Retries with exponential backoff and jitter for idempotent background Google Cloud Functions
// one can also use Google Cloud Firestore library,
// with a slight change in semantics
import { firestore } from 'firebase-admin';
import { EventContext, runWith } from 'firebase-functions';
import { promisify } from 'util';
const eventCollection = 'function-events';
enum EventStatus {
RUNNING = 'running',