Remove unnecessary async
This commit is contained in:
parent
d4223ce604
commit
19da967605
@ -504,15 +504,15 @@ export default class Services {
|
|||||||
await db.clearStore('diffs');
|
await db.clearStore('diffs');
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendNewTxMessage(message: string) {
|
sendNewTxMessage(message: string) {
|
||||||
sendMessage('NewTx', message);
|
sendMessage('NewTx', message);
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendCommitMessage(message: string) {
|
sendCommitMessage(message: string) {
|
||||||
sendMessage('Commit', message);
|
sendMessage('Commit', message);
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendCipherMessages(ciphers: string[]) {
|
sendCipherMessages(ciphers: string[]) {
|
||||||
for (let i = 0; i < ciphers.length; i++) {
|
for (let i = 0; i < ciphers.length; i++) {
|
||||||
const cipher = ciphers[i];
|
const cipher = ciphers[i];
|
||||||
sendMessage('Cipher', cipher);
|
sendMessage('Cipher', cipher);
|
||||||
@ -603,7 +603,7 @@ export default class Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (apiReturn.new_tx_to_send && apiReturn.new_tx_to_send.transaction.length != 0) {
|
if (apiReturn.new_tx_to_send && apiReturn.new_tx_to_send.transaction.length != 0) {
|
||||||
await this.sendNewTxMessage(JSON.stringify(apiReturn.new_tx_to_send));
|
this.sendNewTxMessage(JSON.stringify(apiReturn.new_tx_to_send));
|
||||||
await new Promise(r => setTimeout(r, 500));
|
await new Promise(r => setTimeout(r, 500));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -677,11 +677,11 @@ export default class Services {
|
|||||||
|
|
||||||
if (apiReturn.commit_to_send) {
|
if (apiReturn.commit_to_send) {
|
||||||
const commit = apiReturn.commit_to_send;
|
const commit = apiReturn.commit_to_send;
|
||||||
await this.sendCommitMessage(JSON.stringify(commit));
|
this.sendCommitMessage(JSON.stringify(commit));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (apiReturn.ciphers_to_send && apiReturn.ciphers_to_send.length != 0) {
|
if (apiReturn.ciphers_to_send && apiReturn.ciphers_to_send.length != 0) {
|
||||||
await this.sendCipherMessages(apiReturn.ciphers_to_send);
|
this.sendCipherMessages(apiReturn.ciphers_to_send);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1545,7 +1545,7 @@ export default class Services {
|
|||||||
if (dontRetry.includes(errorMsg)) { return; }
|
if (dontRetry.includes(errorMsg)) { return; }
|
||||||
// Wait and retry
|
// Wait and retry
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
await this.sendCommitMessage(JSON.stringify(content));
|
this.sendCommitMessage(JSON.stringify(content));
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user