Skip to content

Commit 368a3ec

Browse files
committed
# Conflicts: # netlify/functions/test-scheduled-10s.ts # netlify/functions/test-scheduled.ts
2 parents 6cf052b + 9b98229 commit 368a3ec

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

netlify/functions/refresh-stats-cache.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { setCachedGitHubStats } from '~/utils/stats-db.server'
3131
*/
3232
export const handler: Handler = async (
3333
event: HandlerEvent,
34-
context: HandlerContext
34+
context: HandlerContext,
3535
) => {
3636
console.log('[refresh-stats-cache-background] Starting stats refresh...')
3737

@@ -46,20 +46,20 @@ export const handler: Handler = async (
4646

4747
// Refresh GitHub org stats
4848
console.log(
49-
'[refresh-stats-cache-background] Refreshing GitHub org stats...'
49+
'[refresh-stats-cache-background] Refreshing GitHub org stats...',
5050
)
5151
const githubCacheKey = `org:${org}`
5252
const githubStats = await fetchGitHubOwnerStats(org)
5353
await setCachedGitHubStats(githubCacheKey, githubStats, 1)
5454

5555
// Refresh GitHub stats for each library repo
5656
console.log(
57-
'[refresh-stats-cache-background] Refreshing GitHub stats for individual libraries...'
57+
'[refresh-stats-cache-background] Refreshing GitHub stats for individual libraries...',
5858
)
5959
const { libraries } = await import('~/libraries')
6060
console.log(
6161
`[refresh-stats-cache-background] Found ${libraries.length} libraries to process:`,
62-
libraries.map((lib) => ({ id: lib.id, repo: lib.repo }))
62+
libraries.map((lib) => ({ id: lib.id, repo: lib.repo })),
6363
)
6464
const libraryResults = []
6565
const libraryErrors = []
@@ -68,13 +68,13 @@ export const handler: Handler = async (
6868
const library = libraries[i]
6969
if (!library.repo) {
7070
console.log(
71-
`[refresh-stats-cache-background] Skipping library ${library.id} - no repo`
71+
`[refresh-stats-cache-background] Skipping library ${library.id} - no repo`,
7272
)
7373
continue
7474
}
7575

7676
console.log(
77-
`[refresh-stats-cache-background] Processing library ${library.id} (${library.repo})...`
77+
`[refresh-stats-cache-background] Processing library ${library.id} (${library.repo})...`,
7878
)
7979
try {
8080
const repoStats = await fetchGitHubRepoStats(library.repo)
@@ -83,11 +83,11 @@ export const handler: Handler = async (
8383
library.repo
8484
}: ${repoStats.starCount} stars, ${
8585
repoStats.contributorCount
86-
} contributors, ${repoStats.dependentCount ?? 'N/A'} dependents`
86+
} contributors, ${repoStats.dependentCount ?? 'N/A'} dependents`,
8787
)
8888
await setCachedGitHubStats(library.repo, repoStats, 1)
8989
console.log(
90-
`[refresh-stats-cache-background] ✓ Successfully cached stats for ${library.repo}`
90+
`[refresh-stats-cache-background] ✓ Successfully cached stats for ${library.repo}`,
9191
)
9292
libraryResults.push({
9393
repo: library.repo,
@@ -103,7 +103,7 @@ export const handler: Handler = async (
103103
error instanceof Error ? error.message : String(error)
104104
console.error(
105105
`[refresh-stats-cache-background] Failed to refresh ${library.repo}:`,
106-
errorMessage
106+
errorMessage,
107107
)
108108
libraryErrors.push({
109109
repo: library.repo,
@@ -118,7 +118,7 @@ export const handler: Handler = async (
118118
Object.keys(npmStats.packageStats || {}).length
119119
} packages), GitHub Org: ${githubStats.starCount.toLocaleString()} stars, Libraries: ${
120120
libraryResults.length
121-
} refreshed, ${libraryErrors.length} failed`
121+
} refreshed, ${libraryErrors.length} failed`,
122122
)
123123

124124
return {
@@ -154,7 +154,7 @@ export const handler: Handler = async (
154154

155155
console.error(
156156
`[refresh-stats-cache-background] ✗ Failed after ${duration}ms:`,
157-
errorMessage
157+
errorMessage,
158158
)
159159
if (errorStack) {
160160
console.error('[refresh-stats-cache-background] Stack:', errorStack)

netlify/functions/sync-github-releases.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import { syncGitHubReleases } from '~/server/feed/github.functions'
2222
*/
2323
export const handler: Handler = async (
2424
event: HandlerEvent,
25-
context: HandlerContext
25+
context: HandlerContext,
2626
) => {
2727
console.log(
28-
'[sync-github-releases-background] Starting GitHub release sync...'
28+
'[sync-github-releases-background] Starting GitHub release sync...',
2929
)
3030

3131
const startTime = Date.now()
@@ -35,7 +35,7 @@ export const handler: Handler = async (
3535

3636
const duration = Date.now() - startTime
3737
console.log(
38-
`[sync-github-releases-background] ✓ Completed in ${duration}ms - Synced: ${result.syncedCount}, Skipped: ${result.skippedCount}, Errors: ${result.errorCount}`
38+
`[sync-github-releases-background] ✓ Completed in ${duration}ms - Synced: ${result.syncedCount}, Skipped: ${result.skippedCount}, Errors: ${result.errorCount}`,
3939
)
4040

4141
return {
@@ -57,7 +57,7 @@ export const handler: Handler = async (
5757

5858
console.error(
5959
`[sync-github-releases-background] ✗ Failed after ${duration}ms:`,
60-
errorMessage
60+
errorMessage,
6161
)
6262
if (errorStack) {
6363
console.error('[sync-github-releases-background] Stack:', errorStack)

0 commit comments

Comments
 (0)