diff --git a/lib/Command/CacheRefresh.php b/lib/Command/CacheRefresh.php index fae76806..26a688fe 100644 --- a/lib/Command/CacheRefresh.php +++ b/lib/Command/CacheRefresh.php @@ -105,6 +105,9 @@ class CacheRefresh extends Base { $result = $this->actorService->manageCacheLocalActors(); $output->writeLn($result . ' local accounts regenerated'); + $result = $this->personService->missingCacheRemoteActors(); + $output->writeLn($result . ' remote accounts created'); + $result = $this->personService->manageCacheRemoteActors(); $output->writeLn($result . ' remote accounts updated'); diff --git a/lib/Service/ActivityPub/PersonService.php b/lib/Service/ActivityPub/PersonService.php index c170f988..1d3c169a 100644 --- a/lib/Service/ActivityPub/PersonService.php +++ b/lib/Service/ActivityPub/PersonService.php @@ -260,6 +260,25 @@ class PersonService implements ICoreService { } + /** + * @throws Exception + * @return int + */ + public function missingCacheRemoteActors(): int { + // TODO - looking for missing cache remote actors... + $missing = []; + + foreach ($missing as $item) { + try { + $this->getFromId($item->getId()); + } catch (Exception $e) { + } + } + + return sizeof($missing); + } + + /** * @throws Exception * @return int