Skip to content

Commit 25c69b7

Browse files
committed
fix #258
1 parent 56ed319 commit 25c69b7

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/com/dtsx/astra/cli/gateways/db/DbGatewayImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public Optional<KeyspaceRef> tryFindDefaultKeyspace(DbRef dbRef) {
6666

6767
@Override
6868
public boolean exists(DbRef ref) {
69-
return ctx.log().loading("Checking if database " + ctx.highlight(ref) + " exists", (_) -> tryFindOne(ref).isPresent());
69+
return ctx.log().loading("Checking if database " + ctx.highlight(ref) + " exists", (_) -> tryFindOne(ref).filter((db) -> db.getStatus() != TERMINATED).isPresent());
7070
}
7171

7272
@Override

src/main/java/com/dtsx/astra/cli/operations/db/DbDeleteOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public record DbDeleteRequest(
4343
public DbDeleteResult execute() {
4444
val dbInfo = dbGateway.tryFindOne(request.dbRef);
4545

46-
if (dbInfo.isEmpty()) {
46+
if (dbInfo.isEmpty() || dbInfo.get().getStatus() == TERMINATED) {
4747
return handleDbNotFound(request.ifExists);
4848
}
4949

0 commit comments

Comments
 (0)