Bug 1642866 - include details about sending the command in the log. r=rfkelly

Differential Revision: https://phabricator.services.mozilla.com/D82824
This commit is contained in:
Mark Hammond 2020-07-09 05:12:22 +00:00
Родитель 676e2f71c7
Коммит e660db877a
1 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -76,7 +76,17 @@ class FxAccountsCommands {
);
}
try {
await client.invokeCommand(sessionToken, command, device.id, payload);
let info = await client.invokeCommand(
sessionToken,
command,
device.id,
payload
);
if (!info.enqueued || !info.notified) {
log.warn("Sending was only partially successful", info);
} else {
log.info("Successfully sent", info);
}
} catch (err) {
if (err.code && err.code === 429 && err.retryAfter) {
this._invokeRateLimitExpiry = Date.now() + err.retryAfter * 1000;