Skip to content

Commit 05fa245

Browse files
author
sakuraash
committed
fix terminal reconnect bug
1 parent 7a2fa71 commit 05fa245

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

app/backendAPI/websocketClients.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ class TtySocketClient {
117117
} else {
118118
this.socket = io.connect(config.baseURL, { resource: 'coding-ide-tty1' })
119119
}
120-
121120
this.backoff = getBackoff({
122121
delayMin: 1500,
123122
delayMax: 10000,
@@ -160,7 +159,6 @@ class TtySocketClient {
160159
}
161160

162161
reconnect () {
163-
log(`[TTY Socket] Try reconnect ttySocket ${this.backoff.attempts}`)
164162
if (this.backoff.attempts <= this.maxAttempts && !this.socket.connected) {
165163
const timer = setTimeout(() => {
166164
this.connect()

app/components/Terminal/terminal-client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class TerminalClient extends TtySocketClient {
9292
})
9393

9494
this.socket.on('disconnect', (type) => {
95-
console.log('terminal disconnect...')
95+
console.log('[TTY Socket] Terminal disconnect...')
9696
if (config.ttySocketConnected) runInAction(() => config.ttySocketConnected = false)
9797
if (type !== 'manual') {
9898
this.reconnect()
@@ -166,7 +166,7 @@ class TerminalClient extends TtySocketClient {
166166
// this.socket.disconnect()
167167
this.close()
168168
if (this.unbindSocketEvent) this.unbindSocketEvent()
169-
this.socket = null
169+
// this.socket = null ??
170170
SideBar.hideSidePanelView('SIDEBAR.BOTTOM.terminal')
171171
}
172172
}

0 commit comments

Comments
 (0)