mirror of
https://github.com/eliasrenman/gardentron.git
synced 2026-03-16 20:46:07 +01:00
fix: await race promise
This commit is contained in:
@@ -29,7 +29,7 @@ async function process(row: MositureRow) {
|
|||||||
// Enable water gate
|
// Enable water gate
|
||||||
await toggleWater(index, true);
|
await toggleWater(index, true);
|
||||||
// Check moisture level once per second for configured time
|
// Check moisture level once per second for configured time
|
||||||
Promise.race([
|
await Promise.race([
|
||||||
sleep(config.config.timeout * 1000),
|
sleep(config.config.timeout * 1000),
|
||||||
timeoutCb(row.name, row.value.toNumber()),
|
timeoutCb(row.name, row.value.toNumber()),
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user