From b6d0084a49a6c90d1861d978e04cb3d4742cb43f Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Wed, 3 Apr 2024 00:25:42 +0300 Subject: [PATCH] fix(dynamodb): service cannot start if table already exists Now since the container might be reused across simulator updates, we need to make sure we clean up the table before it's being created. --- dynamodb/dynamodb.sim.w | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dynamodb/dynamodb.sim.w b/dynamodb/dynamodb.sim.w index ab2628ff..01a5bc3c 100644 --- a/dynamodb/dynamodb.sim.w +++ b/dynamodb/dynamodb.sim.w @@ -139,6 +139,10 @@ pub class Table_sim impl dynamodb_types.ITable { return nil; })(); + // delete the table if it already exists + try { client.deleteTable({ TableName: tableName }); } + catch e { } + util.waitUntil(() => { try { client.createTable({