Kind Review Note

Make sync retries configurable

src/sync/retry.ts

In reviewApproved
export function retry(task: Task) {
const max = 3;
const max = config.retries ?? 3;
return run(task, max);
Smiling man in a floral shirt

Leonard Cohen

Nice and small. Maybe call it retryLimit so it reads well in the config? Happy to ship either way.

About this piece

Kind Review Note

A small diff gets a friendly note from a reviewer, then the pull request turns approved.

Usage

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}
/>

More Code pieces

View all Code

deploy.ts

Approved
export async function ship(env: string) {
const url = await build(env);
return publish(url);
const out = await build(env, { cache: true });
return publish(out.url, { preview: true });
}
Smiling man in a floral shirt

Brian Eno

Caching here cuts the cold build in half. Lovely.

function greet(name) {
return 'Hi ' + name;
return `Hello, ${name}!`;
}
Terminal
$ npx shadcn@latest add @beste-ui/hero181
components/hero181.tsx
components/ui/button.tsx
Styles come from your own theme tokens
const greeting = "Hello, Beste!";ts
greet.ts
export function greet(name: string) {
return `Hello, ${name}!`;
}
 
console.log(greet("Beste"));
members.ts
import { Sirius } from '@sirius/sdk'
const client = new Sirius(apiKey)
await client.members.create({ name })