Skip to content

Commit

Permalink
Update EarningsTrackerJob.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
nemosminer authored Feb 25, 2018
1 parent 139f932 commit 8dce30f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions EarningsTrackerJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ while ($true) {
if (-not $BalanceData.$TotalJson) {$BalanceData | Add-Member -NotePropertyName $TotalJson -NotePropertyValue ($BalanceData.result.Stats | measure -sum $BalanceJson).sum -Force}
} else {
try {
$BalanceData = Invoke-WebRequest ($APIUri+$Wallet) -UseBasicParsing -Headers @{"Cache-Control"="no-cache"} | ConvertFrom-Json } catch { }
$TempBalanceData = Invoke-WebRequest ($APIUri+$Wallet) -UseBasicParsing -Headers @{"Cache-Control"="no-cache"} | ConvertFrom-Json } catch { }
}
If ($TempBalanceData.$BalanceJson){$BalanceData = $TempBalanceData}

$BalanceObjectS += [PSCustomObject]@{
Date = $CurDate
Expand Down Expand Up @@ -96,6 +97,6 @@ while ($true) {
If ($BalanceObjectS.Count -gt 1) {$BalanceObjectS = $BalanceObjectS | ? {$_.Date -ge $CurDate.AddDays(-1).AddHours(-1)}}

# Sleep until next update based on $Interval. Modulo $Interval.
Sleep (60*($Interval-((get-date).minute%$Interval))-(Get-Date).Second)
Sleep (60*($Interval-((get-date).minute%$Interval)))

}

0 comments on commit 8dce30f

Please sign in to comment.