streams/Zotlabs/Daemon/Channel_purge.php
nobody db503f4af0 - disable Convo (fetches conversation children - the opposite of fetch_parents) because it simply isn't reliable (only implemented in Mastodon) and is also causing load issues on some sites.
- remove items in background from within channel_remove() due to load/memory issues
 - provide purge_all (Delete->Actor) messages over ActivityPub as this functionality was missing.
2021-01-26 11:29:34 -08:00

31 lines
502 B
PHP

<?php
namespace Zotlabs\Daemon;
class Channel_purge {
static public function run($argc,$argv) {
cli_startup();
$channel_id = intval($argv[1]);
$channel = q("select * from channel where channel_id = %d and channel_removed = 1");
if (! $channel) {
return;
}
do {
$r = q("select id from item where uid = %d and item_deleted = 0 limit 1000",
intval($channel_id)
);
if ($r) {
foreach ($r as $rv) {
drop_item($rv['id'],false);
}
}
} while ($r);
}
}