
Make sync retries configurable
src/sync/retry.ts
Leonard Cohen
Nice and small. Maybe call it retryLimit so it reads well in the config? Happy to ship either way.
A small diff gets a friendly note from a reviewer, then the pull request turns approved.
The import and the props worth knowing about, in one place.
import { Code21 } from "@/components/beste/piece/code21";
<Code21
title="Make sync retries configurable"
file="src/sync/retry.ts"
lines={[
{
"kind": "context",
"text": "export function retry(task: Task) {"
},
{
"kind": "remove",
"text": " const max = 3;"
},
{
"kind": "add",
"text": " const max = config.retries ?? 3;"
},
{
"kind": "context",
"text": " return run(task, max);"
}
]}
noteOn={2}
reviewer={{
"name": "Leonard Cohen",
"avatar": {
"src": "https://images.unsplash.com/photo-1656337789708-cdf37b07112d?q=80&w=200&h=200&auto=format&fit=crop",
"alt": "Smiling man in a floral shirt"
}
}}
comment="Nice and small. Maybe call it retryLimit so it reads well in the config? Happy to ship either way."
pendingLabel="In review"
approvedLabel="Approved"
framed={true}
stepMs={900}
/>deploy.ts
Brian Eno
Caching here cuts the cold build in half. Lovely.