Merge pull request #11115 from appwrite/delete-subscribers

This commit is contained in:
Jake Barnby 2026-01-12 18:50:59 +13:00 committed by GitHub
commit a860c33969
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,8 +3,10 @@
namespace Appwrite\Deletes;
use Appwrite\Extend\Exception;
use Utopia\Console;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Exception\Limit as LimitException;
use Utopia\Database\Query;
class Targets
@ -42,12 +44,17 @@ class Targets
MESSAGE_TYPE_PUSH => 'pushTotal',
default => throw new Exception('Invalid target provider type'),
};
$database->decreaseDocumentAttribute(
'topics',
$topicId,
$totalAttribute,
min: 0
);
try {
$database->decreaseDocumentAttribute(
'topics',
$topicId,
$totalAttribute,
min: 0
);
} catch (LimitException $e) {
Console::error("Delete subscribers decreaseDocumentAttribute (topicId={$topicId}): {$e->getMessage()}");
}
}
}
);