Commit 0eb338f
Refresh worker: chunk_size 30 globally (was per-source)
Commit `18fde26` set ashby chunk_size to 30 (down from 100) to dodge
Supabase's default 60 s `statement_timeout` on the service_role REST
path. Greenhouse + Lever + Workday were left at 100 because they
weren't hitting the wall at the time.
Tonight's 00:00 cron tick logs show greenhouse + lever now ALSO
hitting `canceling statement due to statement timeout` at
chunk_size=100:
Failed to upsert chunk for greenhouse: ... statement_timeout
Failed to upsert chunk for greenhouse: ... statement_timeout
Failed to upsert chunk for lever: ... statement_timeout
Failed to upsert chunk for lever: ... statement_timeout
Failed to upsert chunk for lever: ... statement_timeout
The cause is just table growth — cached_jobs is now ~13 K rows, the
GENERATED `search_tsv` tsvector column has to be re-derived on every
insert, and the per-chunk index churn at 100 rows finally crossed
the 60 s budget. ~100-200 rows per refresh were silently dropping
across the two sources.
Fix: drop chunk_size to 30 across all sources. ~3-4× more HTTP
roundtrips per refresh (extra ~250 calls), each one comfortably
under the statement_timeout. Total refresh duration largely
unchanged because the upstream ATS-API fetches dominate the
wall-clock time.
Also rewrote the comment to record this trajectory so the next
person who looks at chunk sizing sees the history without having
to dig through git blame.
(Cron schedule was changed from `*/30 * * * *` to `0 */4 * * *`
in Supabase — six refreshes per day is plenty for cached job
listings, no need to slam the four ATS providers every 30 min.
The change is in pg_cron, not in this repo.)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 23212f1 commit 0eb338f
1 file changed
Lines changed: 22 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
147 | 146 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
157 | 163 | | |
158 | | - | |
| 164 | + | |
159 | 165 | | |
160 | 166 | | |
161 | 167 | | |
| |||
0 commit comments