cmd: improve index logging

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/877/head
Varun Patil 2023-10-13 19:03:13 -07:00
parent 8fb257fa3c
commit 99dfbef88d
2 changed files with 6 additions and 6 deletions

View File

@ -167,7 +167,7 @@ class Index extends Command
}
$this->timelineWrite->clear();
$this->output->writeln('Cleared existing index');
$this->output->writeln('<info>Cleared existing index</info>');
}
/**
@ -191,9 +191,7 @@ class Index extends Command
{
$this->runForUsers(function (IUser $user) {
try {
$uid = $user->getUID();
$this->output->writeln("Indexing user {$uid}");
$this->indexer->indexUser($uid, $this->opts->folder);
$this->indexer->indexUser($user->getUID(), $this->opts->folder);
} catch (\Exception $e) {
$this->output->writeln("<error>{$e->getMessage()}</error>\n");
}

View File

@ -76,6 +76,8 @@ class Index
*/
public function indexUser(string $uid, ?string $folder = null): void
{
$this->log("<info>Indexing user {$uid}</info>".PHP_EOL);
\OC_Util::tearDownFS();
\OC_Util::setupFS($uid);
@ -121,7 +123,7 @@ class Index
public function indexFolder(Folder $folder): void
{
if ($folder->nodeExists('.nomedia') || $folder->nodeExists('.nomemories')) {
$this->log("Skipping folder {$folder->getPath()} due to .nomedia or .nomemories file\n", true);
$this->log("Skipping folder {$folder->getPath()} (.nomedia / .nomemories)\n", true);
return;
}
@ -215,7 +217,7 @@ class Index
*/
public function cleanupStale(): void
{
$this->log('Cleaning up stale index entries'.PHP_EOL);
$this->log('<info>Cleaning up stale index entries</info>'.PHP_EOL);
$this->timelineWrite->cleanupStale();
}