Commit 2eee683
fix: Move metadata counter updates after successful API call in RQ single client
In `mark_request_as_handled`, the `handled_request_count` and
`pending_request_count` metadata counters were updated before the
`_update_request` API call. If the API call failed, the counters
would be left in an inconsistent state with no rollback. This moves
the counter updates to the `else` block so they only execute after
a successful API call.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent ea1f52b commit 2eee683
File tree
1 file changed
+6
-3
lines changed- src/apify/storage_clients/_apify
1 file changed
+6
-3
lines changedLines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
| 208 | + | |
208 | 209 | | |
209 | | - | |
210 | | - | |
211 | 210 | | |
212 | 211 | | |
213 | 212 | | |
| |||
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
| |||
0 commit comments