tracker: carry old startopts to ensure consistent restart behavior

This commit is contained in:
nick-delirium 2024-10-31 17:45:55 +01:00
parent d275ab5344
commit c15c003289
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -757,8 +757,8 @@ export default class App {
this.stop(false)
} else if (data === 'a_start') {
this.waitStatus(ActivityState.NotActive).then(() => {
this.allowAppStart();
this.start({}, true)
this.allowAppStart()
this.start(this.prevOpts, true)
.then((r) => {
this.debug.info('Worker restart, session too long', r)
})
@ -1347,11 +1347,15 @@ export default class App {
this.clearBuffers()
}
prevOpts: StartOptions = {}
private async _start(
startOpts: StartOptions = {},
resetByWorker = false,
conditionName?: string,
): Promise<StartPromiseReturn> {
if (Object.keys(startOpts).length !== 0) {
this.prevOpts = startOpts
}
const isColdStart = this.activityState === ActivityState.ColdStart
if (isColdStart && this.coldInterval) {
clearInterval(this.coldInterval)