a bit more tracing

This commit is contained in:
Andrew Dolgov 2023-04-09 22:36:37 +03:00
parent fd5e0f98c4
commit 44137342a6
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
2 changed files with 13 additions and 0 deletions

View File

@ -581,6 +581,7 @@ class Article extends Handler_Protected {
* @return array<int, Article::ARTICLE_KIND_*|string>
*/
static function _get_image(array $enclosures, string $content, string $site_url, array $headline) {
$scope = Tracer::start(__METHOD__);
$article_image = "";
$article_stream = "";
@ -659,6 +660,8 @@ class Article extends Handler_Protected {
if ($article_stream && $cache->exists(sha1($article_stream)))
$article_stream = $cache->get_url(sha1($article_stream));
$scope->close();
return [$article_image, $article_stream, $article_kind];
}
@ -672,6 +675,8 @@ class Article extends Handler_Protected {
if (count($article_ids) == 0)
return [];
$scope = Tracer::start(__METHOD__);
$entries = ORM::for_table('ttrss_entries')
->table_alias('e')
->join('ttrss_user_entries', ['ref_id', '=', 'id'], 'ue')
@ -691,6 +696,8 @@ class Article extends Handler_Protected {
}
}
$scope->close();
return array_unique($rv);
}
@ -702,6 +709,8 @@ class Article extends Handler_Protected {
if (count($article_ids) == 0)
return [];
$scope = Tracer::start(__METHOD__);
$entries = ORM::for_table('ttrss_entries')
->table_alias('e')
->join('ttrss_user_entries', ['ref_id', '=', 'id'], 'ue')
@ -714,6 +723,8 @@ class Article extends Handler_Protected {
array_push($rv, $entry->feed_id);
}
$scope->close();
return array_unique($rv);
}
}

View File

@ -659,6 +659,7 @@ class PluginHost {
private function save_data(string $plugin): void {
if ($this->owner_uid) {
$scope = Tracer::start(__METHOD__);
if (!$this->pdo_data)
$this->pdo_data = Db::instance()->pdo_connect();
@ -686,6 +687,7 @@ class PluginHost {
}
$this->pdo_data->commit();
$scope->close();
}
}