Skip to content

Commit 346bb43

Browse files
committed
fix(idle): Treat preCheck as async function
1 parent 1d8e941 commit 346bb43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/commands/idle.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async function runIdle(connection) {
1414
let doneSent = false;
1515
let canEnd = false;
1616

17-
let preCheck = () => {
17+
let preCheck = async () => {
1818
doneRequested = true;
1919
if (canEnd && !doneSent) {
2020
connection.log.debug({
@@ -52,7 +52,7 @@ async function runIdle(connection) {
5252
doneSent
5353
});
5454

55-
preCheck();
55+
connection.preCheck().catch(err => connection.log.warn({ err, cid: connection.id }));
5656

5757
return handler;
5858
};
@@ -64,7 +64,7 @@ async function runIdle(connection) {
6464
connection.log.debug({ msg: `Initiated IDLE, waiting for server input`, lockId: connection.currentLock?.lockId, doneRequested });
6565
canEnd = true;
6666
if (doneRequested) {
67-
preCheck();
67+
await connection.preCheck();
6868
}
6969
},
7070
onSend: () => {

0 commit comments

Comments
 (0)