Skip to content

Commit 9eeca9d

Browse files
committed
Add additional logic for channel property
Signed-off-by: worksofliam <[email protected]>
1 parent 1480c9f commit 9eeca9d

File tree

2 files changed

+196
-194
lines changed

2 files changed

+196
-194
lines changed

src/connection/sqlJob.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class OldSQLJob extends SQLJob {
105105
getStatus(): JobStatus {
106106
const currentListenerCount = this.responseEmitter.eventNames().length;
107107

108-
return currentListenerCount > 0 ? "busy" : this.status;
108+
return this.channel && currentListenerCount > 0 ? "busy" : this.status;
109109
}
110110

111111
async connect(): Promise<ConnectionResult> {
@@ -208,6 +208,7 @@ export class OldSQLJob extends SQLJob {
208208

209209
dispose() {
210210
this.channel.close();
211+
this.channel = undefined;
211212
this.status = "ended";
212213
}
213214
}

0 commit comments

Comments
 (0)