mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
add the observer hash to the cache key in categories_widget()
This commit is contained in:
@@ -12,6 +12,7 @@ class Cache_query {
|
|||||||
if(! $argc == 3)
|
if(! $argc == 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
$r = null;
|
||||||
$key = $argv[1];
|
$key = $argv[1];
|
||||||
|
|
||||||
$pid = Config::Get('procid', $key, false);
|
$pid = Config::Get('procid', $key, false);
|
||||||
@@ -29,8 +30,10 @@ class Cache_query {
|
|||||||
$arr = json_decode(base64_decode($argv[0]), true);
|
$arr = json_decode(base64_decode($argv[0]), true);
|
||||||
|
|
||||||
$r = call_user_func_array('q', $arr);
|
$r = call_user_func_array('q', $arr);
|
||||||
if($r)
|
|
||||||
|
if(is_array($r)) {
|
||||||
Cache::set($key, serialize($r));
|
Cache::set($key, serialize($r));
|
||||||
|
}
|
||||||
|
|
||||||
Config::Delete('procid', $key);
|
Config::Delete('procid', $key);
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
use Zotlabs\Lib\Cache;
|
use Zotlabs\Lib\Cache;
|
||||||
use Zotlabs\Lib\Config;
|
use Zotlabs\Lib\Config;
|
||||||
|
use Zotlabs\Daemon\Master;
|
||||||
|
|
||||||
function findpeople_widget() {
|
function findpeople_widget() {
|
||||||
|
|
||||||
@@ -71,7 +72,9 @@ function categories_widget($baseurl,$selected = '') {
|
|||||||
|
|
||||||
$item_normal = item_normal();
|
$item_normal = item_normal();
|
||||||
|
|
||||||
$key = __FUNCTION__ . "-" . App::$profile['profile_uid'];
|
$observer = get_observer_hash();
|
||||||
|
|
||||||
|
$key = __FUNCTION__ . '_' . md5(App::$profile['profile_uid'] . $observer);
|
||||||
|
|
||||||
$content = Cache::get($key, '5 MINUTE');
|
$content = Cache::get($key, '5 MINUTE');
|
||||||
if (! $content) {
|
if (! $content) {
|
||||||
@@ -97,7 +100,7 @@ function categories_widget($baseurl,$selected = '') {
|
|||||||
dbesc(ACTIVITY_UPDATE)
|
dbesc(ACTIVITY_UPDATE)
|
||||||
];
|
];
|
||||||
|
|
||||||
\Zotlabs\Daemon\Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
|
Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$content) {
|
if (!$content) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
use Zotlabs\Lib\Cache;
|
use Zotlabs\Lib\Cache;
|
||||||
use Zotlabs\Lib\Config;
|
use Zotlabs\Lib\Config;
|
||||||
|
use Zotlabs\Daemon\Master;
|
||||||
|
|
||||||
|
|
||||||
function file_tag_encode($s) {
|
function file_tag_encode($s) {
|
||||||
@@ -358,7 +359,7 @@ function pub_tagadelic($net, $site, $limit, $recent, $safemode, $type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$key = __FUNCTION__ . "-" . md5($site . $recent . $safemode . $limit . $type);
|
$key = __FUNCTION__ . '_' . md5($site . $recent . $safemode . $limit . $type);
|
||||||
|
|
||||||
$content = Cache::get($key, '5 MINUTE');
|
$content = Cache::get($key, '5 MINUTE');
|
||||||
if(! $content) {
|
if(! $content) {
|
||||||
@@ -378,7 +379,7 @@ function pub_tagadelic($net, $site, $limit, $recent, $safemode, $type) {
|
|||||||
(intval($count) ? "LIMIT $count" : '')
|
(intval($count) ? "LIMIT $count" : '')
|
||||||
];
|
];
|
||||||
|
|
||||||
\Zotlabs\Daemon\Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
|
Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = unserialize($content);
|
$r = unserialize($content);
|
||||||
|
|||||||
Reference in New Issue
Block a user