mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Invalidate status cache after importing custom emoji
This commit is contained in:
parent
dc7962d898
commit
dbb1638fd6
2 changed files with 6 additions and 6 deletions
|
@ -45,11 +45,7 @@ class StatusTagsPipeline implements ShouldQueue
|
||||||
return $tag && $tag['type'] == 'Emoji';
|
return $tag && $tag['type'] == 'Emoji';
|
||||||
})
|
})
|
||||||
->map(function($tag) {
|
->map(function($tag) {
|
||||||
CustomEmojiService::import($tag['id']);
|
CustomEmojiService::import($tag['id'], $this->status->id);
|
||||||
});
|
});
|
||||||
|
|
||||||
// sleep(15);
|
|
||||||
|
|
||||||
StatusService::del($this->status->id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ class CustomEmojiService
|
||||||
return CustomEmoji::whereShortcode($shortcode)->first();
|
return CustomEmoji::whereShortcode($shortcode)->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function import($url)
|
public static function import($url, $id = false)
|
||||||
{
|
{
|
||||||
if(config('federation.custom_emoji.enabled') == false) {
|
if(config('federation.custom_emoji.enabled') == false) {
|
||||||
return;
|
return;
|
||||||
|
@ -72,6 +72,10 @@ class CustomEmojiService
|
||||||
|
|
||||||
$name = str_replace(':', '', $json['name']);
|
$name = str_replace(':', '', $json['name']);
|
||||||
Cache::forget('pf:custom_emoji:' . $name);
|
Cache::forget('pf:custom_emoji:' . $name);
|
||||||
|
|
||||||
|
if($id) {
|
||||||
|
StatusService::del($id);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue