Skip to content

Commit

Permalink
Fix table-exists?
Browse files Browse the repository at this point in the history
  • Loading branch information
whilo committed Nov 17, 2024
1 parent 49015b3 commit d4e4b88
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/konserve_dynamodb/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
DeleteItemResponse
DeleteTableRequest
DescribeTableRequest
DescribeTableResponse
GetItemRequest
KeySchemaElement
KeySchemaElement$Builder
Expand All @@ -42,7 +43,8 @@
ResourceNotFoundException
ScalarAttributeType
ScanRequest
ScanResponse)))
ScanResponse
TableDescription)))

(set! *warn-on-reflection* true)

Expand All @@ -66,8 +68,7 @@
(let [^DescribeTableRequest request (-> (DescribeTableRequest/builder)
(.tableName table-name)
.build)]
(.describeTable client request)
true)
(= ^String (.tableStatusAsString ^TableDescription (.table ^DescribeTableResponse (.describeTable client request))) "ACTIVE"))
(catch ResourceNotFoundException _
false)))

Expand Down Expand Up @@ -112,7 +113,7 @@
^CreateTableRequest create-table-request
(.build create-table-request-builder)]
(.createTable client create-table-request)
(while (not (table-exists? table-name))
(while (not (table-exists? client table-name))
(Thread/sleep 2000))))

(defn delete-dynamodb-table
Expand Down

0 comments on commit d4e4b88

Please sign in to comment.