mailing: added queue
This commit is contained in:
@@ -47,7 +47,7 @@ export function urlWatcher(conf: Conf, checkValidity: (data: any) => Promise<Url
|
||||
conf.waitingDelay,
|
||||
conf.recallDelay,
|
||||
|
||||
mail.onEstablished(conf, urlConf.address, getOkTitle()),
|
||||
mail.onEstablished(urlConf.address, getOkTitle()),
|
||||
|
||||
// When a disconnection is detected
|
||||
(waitingDelay: number, recallDelay, error?: any) => {
|
||||
@@ -57,14 +57,14 @@ export function urlWatcher(conf: Conf, checkValidity: (data: any) => Promise<Url
|
||||
koTitle = getKoTitle()
|
||||
koMessage = () => `<p>${error.errorMessage}</p>`
|
||||
}
|
||||
return mail.onDisconnect(conf, urlConf.address, koTitle, koMessage)(waitingDelay, recallDelay)
|
||||
return mail.onDisconnect(urlConf.address, koTitle, koMessage)(waitingDelay, recallDelay)
|
||||
},
|
||||
|
||||
async () => {
|
||||
console.log('Trying to connect to %s', urlConf.address)
|
||||
},
|
||||
|
||||
mail.onRestartSuccess(conf, urlConf.address, getRecoveredTitle()),
|
||||
mail.onRestartSuccess(urlConf.address, getRecoveredTitle()),
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ export function webDiffWatcher(conf: Conf) {
|
||||
conf.waitingDelay,
|
||||
conf.recallDelay,
|
||||
|
||||
() => mail.onEstablished(conf, target, 'webdiff successfully started')(webDiffConf.cc),
|
||||
() => mail.onEstablished(target, 'webdiff successfully started')(webDiffConf.cc),
|
||||
|
||||
// When a disconnection is detected
|
||||
(waitingDelay: number, recallDelay: number) => mail.onDisconnect(conf, target, 'Diff detected', undefined, (waitingDelay: number) => `
|
||||
(waitingDelay: number, recallDelay: number) => mail.onDisconnect(target, 'Diff detected', undefined, (waitingDelay: number) => `
|
||||
${htmlDiff}
|
||||
<p>
|
||||
Waiting ${(waitingDelay / 1000).toFixed(0)} seconds before trying to reconnect.
|
||||
@@ -78,7 +78,7 @@ export function webDiffWatcher(conf: Conf) {
|
||||
console.log('Trying to connect to %s', target)
|
||||
},
|
||||
|
||||
() => mail.onRestartSuccess(conf, target)(webDiffConf.cc),
|
||||
() => mail.onRestartSuccess(target)(webDiffConf.cc),
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
@@ -44,16 +44,16 @@ export function ws2pWatcher(conf: Conf) {
|
||||
conf.waitingDelay,
|
||||
conf.recallDelay,
|
||||
|
||||
mail.onEstablished(conf, target, `State OK WS2P on ${wserver.address}`),
|
||||
mail.onEstablished(target, `State OK WS2P on ${wserver.address}`),
|
||||
|
||||
// When a disconnection is detected
|
||||
mail.onDisconnect(conf, target, `State FAILURE WS2P on ${wserver.address}`),
|
||||
mail.onDisconnect(target, `State FAILURE WS2P on ${wserver.address}`),
|
||||
|
||||
async () => {
|
||||
console.log('Trying to connect to %s', target)
|
||||
},
|
||||
|
||||
mail.onRestartSuccess(conf, target, `State RECOVERED WS2P on ${wserver.address}`),
|
||||
mail.onRestartSuccess(target, `State RECOVERED WS2P on ${wserver.address}`),
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user