Skip to content

Commit

Permalink
fix(dynamodb): service cannot start if table already exists
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eladb authored Apr 2, 2024
1 parent 78bcb28 commit b6d0084
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dynamodb/dynamodb.sim.w
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit b6d0084

Please sign in to comment.