Skip to content

Commit

Permalink
fix(hoppie): Updated Hoppie Poll rate (flybywiresim#8283)
Browse files Browse the repository at this point in the history
* Update HoppieConnector.ts

* Update timings

* fix lint

* Update fbw-common/src/systems/datalink/router/src/webinterfaces/HoppieConnector.ts

Co-authored-by: Michael Corcoran <[email protected]>

* Update fbw-common/src/systems/datalink/router/src/webinterfaces/HoppieConnector.ts

Co-authored-by: Michael Corcoran <[email protected]>

---------

Co-authored-by: Michael Corcoran <[email protected]>
  • Loading branch information
alepouna and tracernz authored Nov 24, 2023
1 parent 72a6813 commit aed0810
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,13 @@ export class HoppieConnector {
}
}

/**
* Gets the interval to poll the Hoppie API in milliseconds.
* Warning: This will return a different random time on each invocation!
* @returns The polling interval in milliseconds.
*/
public static pollInterval(): number {
return 5000;
// To comply with Hoppie rate limits, we choose a random number between 45 and 75, as recommend by Hoppie. Ref to: https://www.hoppie.nl/acars/system/tech.html
return Math.random() * 30_000 + 45_000;
}
}

0 comments on commit aed0810

Please sign in to comment.