From e079d4a8b5cedb054b939206a0171edf9a40a14c Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 16 Nov 2023 23:42:03 +0200 Subject: [PATCH] comparison fix --- .../Platform/Tasks/DeleteOrphanedProjects.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/DeleteOrphanedProjects.php b/src/Appwrite/Platform/Tasks/DeleteOrphanedProjects.php index 648a91dc57..757b29c1b6 100644 --- a/src/Appwrite/Platform/Tasks/DeleteOrphanedProjects.php +++ b/src/Appwrite/Platform/Tasks/DeleteOrphanedProjects.php @@ -122,6 +122,15 @@ class DeleteOrphanedProjects extends Action if ($commit) { $dbForConsole->deleteDocument('projects', $project->getId()); $dbForConsole->deleteCachedDocument('projects', $project->getId()); + + if ($dbForProject->exists($dbForProject->getDefaultDatabase(), Database::METADATA)) { + try { + $dbForProject->deleteCollection(Database::METADATA); + $dbForProject->deleteCachedCollection(Database::METADATA); + } catch (\Throwable $th) { + Console::warning('Metadata collection does not exist'); + } + } } Console::info('--Deleting project no (' . $project->getInternalId() . ')'); @@ -149,4 +158,4 @@ class DeleteOrphanedProjects extends Action Console::log('Iterated through ' . $count - 1 . '/' . $totalProjects . ' projects found ' . $orphans - 1 . ' orphans'); } -} \ No newline at end of file +}