singleton object cache - initial commit

This commit is contained in:
Mario
2025-11-20 20:41:20 +00:00
parent b5d673c102
commit ad017baaa6
6 changed files with 111 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ use Zotlabs\Lib\Enotify;
use Zotlabs\Lib\MarkdownSoap;
use Zotlabs\Lib\MessageFilter;
use Zotlabs\Lib\ThreadListener;
use Zotlabs\Lib\ObjCache;
use Zotlabs\Lib\IConfig;
use Zotlabs\Lib\PConfig;
use Zotlabs\Lib\Activity;
@@ -4179,6 +4180,15 @@ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL) {
intval($item['id'])
);
$n = q("SELECT count(id) AS total FROM item WHERE mid = '%s'",
dbesc($item['mid'])
);
if (!$n[0]['total']) {
ObjCache::Delete($item['mid']);
ObjCache::Delete($item['mid'], 'diaspora');
}
q("delete from term where oid = %d and otype = %d",
intval($item['id']),
intval(TERM_OBJ_POST)