Skip to content

Commit

Permalink
log ParserOutput serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
rpuboh committed Jun 29, 2024
1 parent fbd67ba commit e35dd41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions includes/parser/ParserCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,12 @@ public function save(
}

// Save the parser output
$ret = $this->cache->set(
$this->cache->set(
$parserOutputKey,
$parserOutputData,
$expire,
BagOStuff::WRITE_ALLOW_SEGMENTS
);
$jsonstr = substr($parserOutputData, 0, 20);
$origstr = substr($parserOutput->getRawText(), 0, 20);
wfDebugLog('pcd', "$ret; e: $expire; k: $parserOutputKey; d: $jsonstr; o: $origstr");

// ...and its pointer to the local cache.
$this->metadataProcCache->set( $pageKey, $metadataData, $expire );
Expand Down
3 changes: 3 additions & 0 deletions includes/parser/ParserOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -2487,6 +2487,9 @@ protected function toJsonArray(): array {
$data['MaxAdaptiveExpiry'] = $this->mMaxAdaptiveExpiry;
}

$trunc_data = substr(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), 0, 35);
wfDebugLog('pcd', $trunc_data);

return $data;
}

Expand Down

0 comments on commit e35dd41

Please sign in to comment.