Created
October 22, 2016 17:54
-
-
Save talkol/4818c91d2244c8bf5ef91e1ea33cb916 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function pingServers(servers) { | |
| let failedServers = {}; | |
| for (const url of servers) { | |
| let failures = 0; | |
| for (let i = 0 ; i < 3 ; i++) { | |
| const response = blockingHttpRequest(url); | |
| if (!response.ok) failures++; | |
| blockingSleep(10000); | |
| } | |
| if (failures > 0) failedServers[url] = failures; | |
| } | |
| return failedServers; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment