Skip to content

Commit 5dc8c5a

Browse files
committed
feat: flush last command before close window
1 parent a9bb371 commit 5dc8c5a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • backend/framework/src/main/java/org/jumpserver/chen/framework/console

backend/framework/src/main/java/org/jumpserver/chen/framework/console/QueryConsole.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,14 @@ private void sendDataView(DataView dataView, boolean clearOthers) {
464464

465465
@Override
466466
public void close() {
467+
if (this.currentPlan != null) {
468+
// flush
469+
var session = SessionManager.getCurrentSession();
470+
var lastCmd = this.currentPlan.getTargetSQL();
471+
var cmdRecord = new CommandRecord(lastCmd);
472+
cmdRecord.setError("Abnormal exit");
473+
session.recordCommand(cmdRecord);
474+
}
467475
log.info("console closed");
468476
}
469477
}

0 commit comments

Comments
 (0)