File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -131,14 +131,16 @@ Process
131
131
132
132
while ($Repeat )
133
133
{
134
- # hijacks are established every hour on the hour
134
+ # hijacks are established every hour on the hour?
135
135
# so calc diff to next hour plus a minute for wiggle room
136
136
137
- $sleep = (New-TimeSpan - End (get-date - Minute 0 - Second 0 ).AddHours(1 )).TotalSeconds + 60
138
- $minutes = [Math ]::Round($sleep / 60 )
137
+ $span = New-TimeSpan - End (get-date - Minute 0 - Second 0 ).AddHours(1 )
138
+ # check every 20 mins on the 20 minute mark
139
+ $seconds = ($span.Minutes -gt 20 ) ? (($span.Minutes % 20 + 1 ) * 60 ) + 60 : $span.TotalSeconds + 60
140
+ $minutes = [Math ]::Round($seconds / 60 )
139
141
140
142
Write-Host " ... $ ( (get-date ).toString(' yyyy-MM-dd hh:mm' )) sleeping $minutes minutes"
141
- Start-Sleep - Seconds $sleep
143
+ Start-Sleep - Seconds $seconds
142
144
FixEmAll
143
145
}
144
146
}
You can’t perform that action at this time.
0 commit comments