From ab6614a6831ee6a29634638f5b9ecfd05e14689d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 6 Jun 2024 17:38:52 +0100 Subject: [PATCH] Capturing any 500s which occur from SQS cleanup - it appears to 500 if there is nothing to do. --- packages/backend-core/src/db/couch/DatabaseImpl.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/src/db/couch/DatabaseImpl.ts b/packages/backend-core/src/db/couch/DatabaseImpl.ts index 2b589ed09a..ed79a14340 100644 --- a/packages/backend-core/src/db/couch/DatabaseImpl.ts +++ b/packages/backend-core/src/db/couch/DatabaseImpl.ts @@ -328,7 +328,14 @@ export class DatabaseImpl implements Database { async sqlDiskCleanup(): Promise { const dbName = this.name const url = `/${dbName}/_cleanup` - return await this._sqlQuery(url, "POST") + try { + await this._sqlQuery(url, "POST") + } catch (err: any) { + // hack for now - SQS throws a 500 when there is nothing to clean-up + if (err.status !== 500) { + throw err + } + } } // removes a document from sqlite