Skip to content

Commit

Permalink
Add log when failed to set owned on JAVLibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Jul 22, 2020
1 parent f4f85fc commit d41e254
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Javinizer/Private/Set-JavlibraryOwned.ps1
Expand Up @@ -10,7 +10,6 @@ function Set-JavlibraryOwned {
Write-Debug "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Url: $JavlibraryUrl"

try {
$index = 0
$timeout = New-TimeSpan -Seconds $Settings.JavLibrary.'request-timeout-sec'
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
while ($check.content -notmatch '"ERROR":1' -and $stopwatch.elapsed -lt $timeout) {
Expand Down Expand Up @@ -43,9 +42,11 @@ function Set-JavlibraryOwned {

if ($stopwatch.elapsed -gt $timeout) {
Write-Error "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Movie [$JavlibraryUrl] timed out while setting owned status"
Write-Log -Log $javinizerLogPath -Level ERROR -Text "Movie [$JavlibraryUrl] timed out while setting owned status"
}
} catch {
Write-Error "[$(Get-TimeStamp)][$($MyInvocation.MyCommand.Name)] Error setting owned status for [$JavlibraryUrl]: $PSItem"
Write-Log -Log $javinizerLogPath -Level ERROR -Text "Error setting owned status for [$JavlibraryUrl]: $PSItem"
}
}

Expand Down

0 comments on commit d41e254

Please sign in to comment.