fix: guard push ledger cleanup for missing collection

Co-authored-by: ArnabChatterjee20k <83803257+ArnabChatterjee20k@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]andArnabChatterjee20k authored and GitHub committed 2026-09-19 17:26:33 +00:00
1 parent d6b820e064
commit d0e8faf6c9
1 file changed
+4
@@ -1930,6 +1930,10 @@ class Deletes extends Action
Console::info('Delete expired push ledger messages');
$dbForProject = $getProjectDB($project);
if ($dbForProject->getCollection('appwritePushLedger')->isEmpty()) {
return;
}
$expired = DateTime::addSeconds(new \DateTime(), -1 * 60 * 60 * 24 * 7);
$dbForProject->deleteDocuments('appwritePushLedger', [