GitHost.io will be shut down on June 1, 2019. At that point this instance will be unreachable and all data will be irrevocably deleted. More details at https://about.gitlab.com/gitlab-hosted/#githost-is-shutting-down-on-june-1st-2019

Commit d4b7f5d8 authored by Evan Prodromou's avatar Evan Prodromou

TagSub doesn't refetch empty set of tag subscriptions

parent 144755d1
......@@ -146,18 +146,18 @@ class TagSub extends Managed_DataObject
$keypart = sprintf('tagsub:by_profile:%d', $profile->id);
$tagstring = self::cacheGet($keypart);
if ($tagstring !== false && !empty($tagstring)) {
$tags = explode(',', $tagstring);
if ($tagstring !== false) { // cache hit
if (!empty($tagstring)) {
$tags = explode(',', $tagstring);
}
} else {
$tagsub = new TagSub();
$tagsub = new TagSub();
$tagsub->profile_id = $profile->id;
$tagsub->selectAdd();
$tagsub->selectAdd('tag');
if ($tagsub->find()) {
while ($tagsub->fetch()) {
if (!empty($tagsub->tag)) {
$tags[] = $tagsub->tag;
}
}
$tags = $tagsub->fetchAll('tag');
}
self::cacheSet($keypart, implode(',', $tags));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment