mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-07 00:17:17 +08:00
enhance the rerun logic for read no reply auto reminder
This commit is contained in:
@@ -14,7 +14,8 @@ let browser: null | Browser = null
|
|||||||
const mainLoop = async () => {
|
const mainLoop = async () => {
|
||||||
if (browser) {
|
if (browser) {
|
||||||
try {
|
try {
|
||||||
await browser?.close()
|
const cp = browser.process()
|
||||||
|
cp?.kill('SIGKILL')
|
||||||
} catch {
|
} catch {
|
||||||
//
|
//
|
||||||
} finally {
|
} finally {
|
||||||
@@ -187,9 +188,14 @@ export async function runEntry() {
|
|||||||
try {
|
try {
|
||||||
await mainLoop()
|
await mainLoop()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
await browser?.close()
|
console.error(err)
|
||||||
|
try {
|
||||||
|
await pageMapByName['boss']?.close()
|
||||||
|
} catch {
|
||||||
|
//
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
browser = null
|
pageMapByName['boss'] = null
|
||||||
await sleep(rerunInterval)
|
await sleep(rerunInterval)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,3 +204,12 @@ export async function runEntry() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
attachListenerForKillSelfOnParentExited()
|
attachListenerForKillSelfOnParentExited()
|
||||||
|
|
||||||
|
process.once('uncaughtException', (error) => {
|
||||||
|
console.error('uncaughtException', error)
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
process.once('unhandledRejection', (error) => {
|
||||||
|
console.log('unhandledRejection', error)
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user