mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-05-19 16:39:31 +08:00
add error catcher for pipeForRead; remove the logic exit process on pipe error
This commit is contained in:
@@ -150,6 +150,9 @@ export const waitForProcessHandShakeAndRunAutoChat = () => {
|
||||
setSuicideTimer()
|
||||
|
||||
const pipeForRead: fs.ReadStream = fs.createReadStream(null, { fd: 3 })
|
||||
pipeForRead.on('error', () => {
|
||||
return
|
||||
})
|
||||
const pipeForReadWithJsonParser = pipeForRead.pipe(JSONStream.parse())
|
||||
pipeForReadWithJsonParser?.on('data', function waitForCanRun(data) {
|
||||
if (data.type === 'GEEK_AUTO_START_CHAT_CAN_BE_RUN') {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as fs from 'fs'
|
||||
import { type Stream } from 'stream'
|
||||
import { app } from 'electron'
|
||||
const pipeSet = new WeakSet<Stream>()
|
||||
|
||||
export const pipeWriteRegardlessError = async (
|
||||
@@ -17,8 +16,6 @@ export const pipeWriteRegardlessError = async (
|
||||
return pipe?.write(chunk, option, (error) => {
|
||||
if (error) {
|
||||
console.log('pipe.write Error', error)
|
||||
app.exit(1)
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user