From 0dc959d9fe40bddce5e99b8162bb0e770fc28ed9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 24 Mar 2024 09:58:21 +0000 Subject: Deprecate *_config() functions in core. --- Zotlabs/Daemon/Cache_query.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Daemon/Cache_query.php') diff --git a/Zotlabs/Daemon/Cache_query.php b/Zotlabs/Daemon/Cache_query.php index cd9597e9a..8e5c6b2ea 100644 --- a/Zotlabs/Daemon/Cache_query.php +++ b/Zotlabs/Daemon/Cache_query.php @@ -3,6 +3,7 @@ namespace Zotlabs\Daemon; use Zotlabs\Lib\Cache; +use Zotlabs\Lib\Config; class Cache_query { @@ -13,14 +14,14 @@ class Cache_query { $key = $argv[1]; - $pid = get_config('procid', $key, false); + $pid = Config::Get('procid', $key, false); if ($pid && (function_exists('posix_kill') ? posix_kill($pid, 0) : true)) { logger($key . ': procedure already run with pid ' . $pid, LOGGER_DEBUG); return; } $pid = getmypid(); - set_config('procid', $key, $pid); + Config::Set('procid', $key, $pid); array_shift($argv); array_shift($argv); @@ -31,7 +32,7 @@ class Cache_query { if($r) Cache::set($key, serialize($r)); - del_config('procid', $key); + Config::Delete('procid', $key); return; } -- cgit v1.2.3 From 842df8a7991688ccb0770dcca0119acf728e1c8b Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 25 Mar 2024 16:09:53 +0000 Subject: add the observer hash to the cache key in categories_widget() --- Zotlabs/Daemon/Cache_query.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Daemon/Cache_query.php') diff --git a/Zotlabs/Daemon/Cache_query.php b/Zotlabs/Daemon/Cache_query.php index 8e5c6b2ea..d5788795f 100644 --- a/Zotlabs/Daemon/Cache_query.php +++ b/Zotlabs/Daemon/Cache_query.php @@ -12,6 +12,7 @@ class Cache_query { if(! $argc == 3) return; + $r = null; $key = $argv[1]; $pid = Config::Get('procid', $key, false); @@ -29,8 +30,10 @@ class Cache_query { $arr = json_decode(base64_decode($argv[0]), true); $r = call_user_func_array('q', $arr); - if($r) + + if(is_array($r)) { Cache::set($key, serialize($r)); + } Config::Delete('procid', $key); -- cgit v1.2.3