mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
chore: let deleteByGroup failures reach the worker error handler
Previously a failed batch delete was caught and swallowed, acking the message as if it succeeded even though the documents remained. Let the error propagate so the worker marks the message failed and retries. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
844d21d776
commit
bf4d620a5c
1 file changed
+9
-12
@@ -610,23 +610,20 @@ class Databases extends Action
|
||||
* @param Database $database
|
||||
* @param callable|null $callback
|
||||
* @return void
|
||||
* @throws Exception
|
||||
* @throws \Throwable
|
||||
*/
|
||||
protected function deleteByGroup(string $collectionId, array $queries, Database $database, ?callable $callback = null): void
|
||||
{
|
||||
Span::add('delete_by_group.collection.id', $collectionId);
|
||||
|
||||
try {
|
||||
$count = $database->deleteDocuments(
|
||||
$collectionId,
|
||||
$queries,
|
||||
Database::DELETE_BATCH_SIZE,
|
||||
$callback
|
||||
);
|
||||
} catch (\Throwable $th) {
|
||||
Span::add('delete_by_group.error', $th->getMessage());
|
||||
return;
|
||||
}
|
||||
// A failed batch delete is non-recoverable: let it propagate to the
|
||||
// worker's error handler so the message is marked failed and retried.
|
||||
$count = $database->deleteDocuments(
|
||||
$collectionId,
|
||||
$queries,
|
||||
Database::DELETE_BATCH_SIZE,
|
||||
$callback
|
||||
);
|
||||
|
||||
Span::add('delete_by_group.count', $count);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user