fix(xo-server/runJob): emit job:terminated
and forward error
Introduced in fd560c351
This commit is contained in:
parent
e229deb238
commit
cfe6b0d9ab
@ -269,6 +269,8 @@ export default class Jobs {
|
||||
key: job.key,
|
||||
type,
|
||||
})
|
||||
|
||||
const app = this._app
|
||||
try {
|
||||
const runningJobs = this._runningJobs
|
||||
|
||||
@ -290,8 +292,6 @@ export default class Jobs {
|
||||
delete runningJobs[id]
|
||||
})
|
||||
|
||||
const app = this._app
|
||||
|
||||
if (type === 'backup') {
|
||||
const hookData = {
|
||||
callId: Math.random().toString(36).slice(2),
|
||||
@ -389,6 +389,8 @@ export default class Jobs {
|
||||
},
|
||||
true
|
||||
)
|
||||
app.emit('job:terminated', runJobId, { type })
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user