mirror of
https://github.com/chirimen-oh/node-web-gpio.git
synced 2025-01-18 08:05:07 +00:00
add 10 retry GPIO export polling
This commit is contained in:
parent
4b12d332ff
commit
3a5ae2bfba
1 changed files with 1 additions and 1 deletions
2
index.ts
2
index.ts
|
@ -253,7 +253,7 @@ export class GPIOPort extends EventEmitter {
|
||||||
}
|
}
|
||||||
// biome-ignore lint/suspicious/noExplicitAny:
|
// biome-ignore lint/suspicious/noExplicitAny:
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (this._exportRetry === 0) {
|
if (this._exportRetry < 10) {
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
console.warn('May be the first time port access. Retry..');
|
console.warn('May be the first time port access. Retry..');
|
||||||
++this._exportRetry;
|
++this._exportRetry;
|
||||||
|
|
Loading…
Add table
Reference in a new issue