fix(xo-server/xen-servers): handle loosing connection case (#3841)

Fixes #3839
This commit is contained in:
badrAZ 2019-01-09 13:46:17 +01:00 committed by Julien Fontanet
parent 83fe490dbb
commit e9a7421be6
2 changed files with 7 additions and 0 deletions

View File

@ -15,6 +15,7 @@
- [Self] Display sorted Resource Sets [#3818](https://github.com/vatesfr/xen-orchestra/issues/3818) (PR [#3823](https://github.com/vatesfr/xen-orchestra/pull/3823))
- [Servers] Correctly report connecting status (PR [#3838](https://github.com/vatesfr/xen-orchestra/pull/3838))
- [Servers] Fix cannot reconnect to a server after connection has been lost [#3839](https://github.com/vatesfr/xen-orchestra/issues/3839) (PR [#3841](https://github.com/vatesfr/xen-orchestra/pull/3841))
### Released packages

View File

@ -375,6 +375,12 @@ export default class {
xapi.watchEvents()
this.updateXenServer(id, { error: null })::ignoreErrors()
xapi.once('disconnected', () => {
xapi.xo.uninstall()
delete this._xapis[server.id]
delete this._serverIdsByPool[poolId]
})
} catch (error) {
delete this._xapis[server.id]
xapi.disconnect()::ignoreErrors()