Skip to content

Commit 968f55c

Browse files
ci: apply automated fixes
1 parent 5757ade commit 968f55c

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

src/server/github.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ export function normalizeGitHubApiError(error: unknown, context: string) {
6161
typeof error === 'object' && error && 'response' in error
6262
? (error.response as { headers?: Record<string, string> }).headers
6363
: undefined
64-
const message =
65-
error instanceof Error ? error.message : `${context} failed`
64+
const message = error instanceof Error ? error.message : `${context} failed`
6665

6766
if (status === 401) {
6867
return new GitHubApiError({
@@ -72,7 +71,10 @@ export function normalizeGitHubApiError(error: unknown, context: string) {
7271
})
7372
}
7473

75-
if (status === 403 && getHeader(responseHeaders, 'x-ratelimit-remaining') === '0') {
74+
if (
75+
status === 403 &&
76+
getHeader(responseHeaders, 'x-ratelimit-remaining') === '0'
77+
) {
7678
const resetAt = parseRateLimitReset(responseHeaders)
7779
return new GitHubApiError({
7880
kind: 'rate_limited',

src/server/sponsors.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export type Sponsor = {
2828
createdAt: string
2929
}
3030

31-
const SPONSOR_CACHE_TTL_MS = process.env.NODE_ENV === 'development' ? 1 : 5 * 60 * 1000
31+
const SPONSOR_CACHE_TTL_MS =
32+
process.env.NODE_ENV === 'development' ? 1 : 5 * 60 * 1000
3233

3334
export const getSponsorsForSponsorPack = createServerFn({
3435
method: 'GET',
@@ -42,16 +43,22 @@ export const getSponsorsForSponsorPack = createServerFn({
4243
fn: getSponsors,
4344
shouldFallbackToStale: isRecoverableGitHubApiError,
4445
onStaleFallback: (error) => {
45-
console.warn('[getSponsorsForSponsorPack] Serving stale sponsors after GitHub failure:', {
46-
message: error instanceof Error ? error.message : String(error),
47-
})
46+
console.warn(
47+
'[getSponsorsForSponsorPack] Serving stale sponsors after GitHub failure:',
48+
{
49+
message: error instanceof Error ? error.message : String(error),
50+
},
51+
)
4852
},
4953
})
5054
} catch (error) {
5155
if (isRecoverableGitHubApiError(error)) {
52-
console.warn('[getSponsorsForSponsorPack] Falling back to metadata-only sponsors:', {
53-
message: error.message,
54-
})
56+
console.warn(
57+
'[getSponsorsForSponsorPack] Falling back to metadata-only sponsors:',
58+
{
59+
message: error.message,
60+
},
61+
)
5562
sponsors = await getSponsorsFromMetadataOnly()
5663
} else {
5764
throw error

0 commit comments

Comments
 (0)