fix: reduce db pool size to prevent connection exhaustion, sort grouped views by count
Pool was 20+10 overflow per engine; uvicorn --reload leaked pools until Postgres hit max_connections=100. Reduced to 5+5 with pool_pre_ping. Grouped views (tags, people, colors, rated) now sort cards largest-first. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ export function RatedView() {
|
||||
}
|
||||
}
|
||||
|
||||
// Highest rating first
|
||||
// Sort by count, biggest first
|
||||
const result: RatingGroup[] = []
|
||||
for (let r = 5; r >= 1; r--) {
|
||||
const photos = buckets.get(r) ?? []
|
||||
@@ -49,6 +49,7 @@ export function RatedView() {
|
||||
representative: photos[0],
|
||||
})
|
||||
}
|
||||
result.sort((a, b) => b.count - a.count)
|
||||
return result
|
||||
}, [allPhotos])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user