From 42768937fd1f77d4a2e694e393a9fbaf9d16346b Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Mon, 27 Feb 2023 15:30:03 +0100 Subject: [PATCH] Disabled `autoRefresh` when adding an email recipient failure - we don't need the updated model once we've saved it in the DB, so we can disable the auto refresh in Bookshelf to save a query --- ghost/email-service/lib/email-event-storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/email-service/lib/email-event-storage.js b/ghost/email-service/lib/email-event-storage.js index dfc2fdc93b..0cb4fbbc06 100644 --- a/ghost/email-service/lib/email-event-storage.js +++ b/ghost/email-service/lib/email-event-storage.js @@ -86,7 +86,7 @@ class EmailEventStorage { enhanced_code: event.error.enhancedCode, failed_at: event.timestamp, event_id: event.id - }, options); + }, {...options, autoRefresh: false}); } else { if (existing.get('severity') === 'permanent') { // Already marked as failed, no need to change anything here