Skip to content

Commit

Permalink
Show the new cache id we are using
Browse files Browse the repository at this point in the history
  • Loading branch information
spotweb committed Oct 20, 2013
1 parent 411932d commit b9ea254
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions check-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,18 @@
try {
$cacheDao->getCacheContent($cacheItem['id'], $cacheItem['cachetype'], $cacheItem['metadata']);
} catch(CacheIsCorruptException $x) {
echo PHP_EOL . ' Trying to fetch #' . $cacheItem['id'] . ' for ' . $cacheItem['resourceid'] . ' again' . PHP_EOL;
echo PHP_EOL . ' Trying to fetch #' . $cacheItem['id'] . ' for ' . $cacheItem['resourceid'] . ' again, ';

switch($cacheItem['cachetype']) {
case Dao_Cache::SpotNzb : {
try {
$fullSpot = $svcFullSpot->fetchFullSpot($cacheItem['resourceid'], 1);
$svcNzb->fetchNzb($fullSpot);

$cacheInfo = $cacheDao->getCachedNzb($cacheItem['resourceid']);
echo 'retrieved NZB as ' . $cacheInfo['id'] . PHP_EOL;
} catch(Exception $x) {
echo PHP_EOL . ' Error redownload NZB: '. $x->getMessage() . PHP_EOL;
echo 'error redownloading NZB: '. $x->getMessage() . PHP_EOL;
} # catch

break;
Expand All @@ -84,8 +87,11 @@
try {
$fullSpot = $svcFullSpot->fetchFullSpot($cacheItem['resourceid'], 1);
$svcImage->fetchSpotImage($fullSpot);

$cacheInfo = $cacheDao->getCachedSpotImage($cacheItem['resourceid']);
echo 'retrieved image as ' . $cacheInfo['id'] . PHP_EOL;
} catch(Exception $x) {
echo PHP_EOL . ' Error redownload image: '. $x->getMessage() . PHP_EOL;
echo 'error redownloading image: '. $x->getMessage() . PHP_EOL;
} # catch

break;
Expand Down

0 comments on commit b9ea254

Please sign in to comment.