mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
improve pieces hash log
This commit is contained in:
@@ -792,13 +792,14 @@ HTML;
|
|||||||
$pipe->hGet(self::PIECES_HASH_CACHE_KEY, $hash);
|
$pipe->hGet(self::PIECES_HASH_CACHE_KEY, $hash);
|
||||||
}
|
}
|
||||||
$results = $pipe->exec();
|
$results = $pipe->exec();
|
||||||
|
$logPrefix = sprintf("piecesHashCount: %s, resultCount: %s", count($piecesHash), count($results));
|
||||||
$out = [];
|
$out = [];
|
||||||
foreach ($results as $item) {
|
foreach ($results as $item) {
|
||||||
$arr = json_decode($item, true);
|
$arr = json_decode($item, true);
|
||||||
if (is_array($arr) && isset($arr['torrent_id'], $arr['pieces_hash'])) {
|
if (is_array($arr) && isset($arr['torrent_id'], $arr['pieces_hash'])) {
|
||||||
$out[$arr['pieces_hash']] = $arr['torrent_id'];
|
$out[$arr['pieces_hash']] = $arr['torrent_id'];
|
||||||
} else {
|
} else {
|
||||||
do_log("invalid item: $item", 'error');
|
do_log(sprintf("%s, invalid item: %s(%s)", $logPrefix, var_export($item, true), gettype($item)), 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $out;
|
return $out;
|
||||||
|
|||||||
Reference in New Issue
Block a user