Browse Source

getzig.ps1 short-circuit for hosts close to gitea1.intx.com.au

master
Julian Noble 2 weeks ago
parent
commit
24ee059261
  1. 10
      bin/getzig.cmd
  2. 10
      src/scriptapps/getzig.ps1

10
bin/getzig.cmd

@ -937,6 +937,14 @@ if ($mirrors_response.StatusCode -eq 200) {
}
#write-host "dict: $($dict_mirrors | out-String)"
write-host "host_list: $host_list"
$automation_name = "punkshell+julian@precisium.com.au_target_by_latency"
$trace = test-netconnection gitea1.intx.com.au -Hops 6 -TraceRoute -ErrorAction Ignore
if ((${trace}.PingSucceeded) -and (${trace}.TraceRoute.Count -lt 5)) {
$dict_mirrors["gitea1.intx.com.au"]["latency"] = 2
#short-circuit for hosts very near gitea1.intx.com.au
#don't even test others. This is primarily for hosts at intx.com.au and associated entities - which are more likely to use punkshell than anyone else.
} else {
if ($PSVersionTable.PSEdition -eq "Desktop") {
#powershell.exe
#we seem to need -ErrorAction Ignore for bad/unresponsive host entries - but unlike with pwsh, we don't get any corresponding entry in the test_results, and -Quiet doesn't seem to give us results either REVIEW
@ -974,6 +982,7 @@ if ($mirrors_response.StatusCode -eq 200) {
}
}
}
$list_mirror_dicts = @()
#write-host "dict tested: $($dict_mirrors | Out-String)"
@ -984,7 +993,6 @@ if ($mirrors_response.StatusCode -eq 200) {
$sorted_mirror_dicts = $list_mirror_dicts | Sort-Object -Property { [int]$_.latency }
#Write-Host "Sorted by latency: $($sorted_mirror_dicts | Format-Table -AutoSize | Out-String)"
Write-Host "Sorted by latency: $($sorted_mirror_dicts | Out-String)"
$automation_name = "punkshell+julian@precisium.com.au_target_by_latency"
foreach ($hostinfo in $sorted_mirror_dicts) {
$uristring = $hostinfo.uri

10
src/scriptapps/getzig.ps1

@ -103,6 +103,14 @@ if ($mirrors_response.StatusCode -eq 200) {
}
#write-host "dict: $($dict_mirrors | out-String)"
write-host "host_list: $host_list"
$automation_name = "punkshell+julian@precisium.com.au_target_by_latency"
$trace = test-netconnection gitea1.intx.com.au -Hops 6 -TraceRoute -ErrorAction Ignore
if ((${trace}.PingSucceeded) -and (${trace}.TraceRoute.Count -lt 5)) {
$dict_mirrors["gitea1.intx.com.au"]["latency"] = 2
#short-circuit for hosts very near gitea1.intx.com.au
#don't even test others. This is primarily for hosts at intx.com.au and associated entities - which are more likely to use punkshell than anyone else.
} else {
if ($PSVersionTable.PSEdition -eq "Desktop") {
#powershell.exe
#we seem to need -ErrorAction Ignore for bad/unresponsive host entries - but unlike with pwsh, we don't get any corresponding entry in the test_results, and -Quiet doesn't seem to give us results either REVIEW
@ -140,6 +148,7 @@ if ($mirrors_response.StatusCode -eq 200) {
}
}
}
$list_mirror_dicts = @()
#write-host "dict tested: $($dict_mirrors | Out-String)"
@ -150,7 +159,6 @@ if ($mirrors_response.StatusCode -eq 200) {
$sorted_mirror_dicts = $list_mirror_dicts | Sort-Object -Property { [int]$_.latency }
#Write-Host "Sorted by latency: $($sorted_mirror_dicts | Format-Table -AutoSize | Out-String)"
Write-Host "Sorted by latency: $($sorted_mirror_dicts | Out-String)"
$automation_name = "punkshell+julian@precisium.com.au_target_by_latency"
foreach ($hostinfo in $sorted_mirror_dicts) {
$uristring = $hostinfo.uri

Loading…
Cancel
Save