cmd: improve index logging
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/877/head
parent
8fb257fa3c
commit
99dfbef88d
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue