From 3f603995f525e170ee30943670751af773029df1 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Sat, 24 Feb 2024 14:43:33 +0000 Subject: [PATCH] Make sure we're revoking API keys before throwing an exception --- src/Appwrite/Platform/Workers/Migrations.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 9a37d4e6db..45599f4be3 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -340,6 +340,9 @@ class Migrations extends Action $migrationDocument->setAttribute('errors', $errorMessages); } } finally { + if ($tempAPIKey) { + $this->removeAPIKey($tempAPIKey); + } if ($migrationDocument) { $this->updateMigrationDocument($migrationDocument, $projectDocument); @@ -347,9 +350,6 @@ class Migrations extends Action throw new Exception(implode("\n", $migrationDocument->getAttribute('errors', [])); } } - if ($tempAPIKey) { - $this->removeAPIKey($tempAPIKey); - } } } }