parent
355cddc044
commit
942ddfa742
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
- [Backup NG form] Fix schedule's name overridden with undefined if it's not been edited [#3286](https://github.com/vatesfr/xen-orchestra/issues/3286) (PR [#3288](https://github.com/vatesfr/xen-orchestra/pull/3288))
|
- [Backup NG form] Fix schedule's name overridden with undefined if it's not been edited [#3286](https://github.com/vatesfr/xen-orchestra/issues/3286) (PR [#3288](https://github.com/vatesfr/xen-orchestra/pull/3288))
|
||||||
- [Remotes] Don't change `enabled` state on errors (PR [#3318](https://github.com/vatesfr/xen-orchestra/pull/3318))
|
- [Remotes] Don't change `enabled` state on errors (PR [#3318](https://github.com/vatesfr/xen-orchestra/pull/3318))
|
||||||
|
- [Remotes] Auto-reconnect on use if necessary [#2852](https://github.com/vatesfr/xen-orchestra/issues/2852) (PR [#3320](https://github.com/vatesfr/xen-orchestra/pull/3320))
|
||||||
|
|
||||||
### Released packages
|
### Released packages
|
||||||
|
|
||||||
|
@ -59,6 +59,15 @@ export default class {
|
|||||||
if (handler === undefined) {
|
if (handler === undefined) {
|
||||||
handler = handlers[id] = getHandler(remote)
|
handler = handlers[id] = getHandler(remote)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await handler.sync()
|
||||||
|
ignoreErrors.call(this._updateRemote(id, { error: '' }))
|
||||||
|
} catch (error) {
|
||||||
|
ignoreErrors.call(this._updateRemote(id, { error: error.message }))
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
|
||||||
return handler
|
return handler
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,20 +98,15 @@ export default class {
|
|||||||
return /* await */ this.updateRemote(remote.get('id'), { enabled: true })
|
return /* await */ this.updateRemote(remote.get('id'), { enabled: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateRemote (id, { name, url, enabled }) {
|
updateRemote (id, { name, url, enabled }) {
|
||||||
const remote = await this._updateRemote(id, { name, url, enabled })
|
const handlers = this._handlers
|
||||||
|
const handler = handlers[id]
|
||||||
// force refreshing the handler
|
if (handler !== undefined) {
|
||||||
delete this._handlers[id]
|
delete this._handlers[id]
|
||||||
const handler = await this.getRemoteHandler(remote, true)
|
ignoreErrors.call(handler.forget())
|
||||||
|
|
||||||
let error = ''
|
|
||||||
try {
|
|
||||||
await handler.sync()
|
|
||||||
} catch (error_) {
|
|
||||||
error = error_.message
|
|
||||||
}
|
}
|
||||||
return this._updateRemote(id, { error })
|
|
||||||
|
return this._updateRemote(id, { name, url, enabled })
|
||||||
}
|
}
|
||||||
|
|
||||||
@synchronized()
|
@synchronized()
|
||||||
|
Loading…
Reference in New Issue
Block a user