1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00

Simplify parser cache files maintenance

Delete files that were not modified during a no-diff run
This commit is contained in:
Tomasz Mlynski 2021-12-06 17:55:53 +01:00
parent af23619653
commit 0fcad43581
2 changed files with 2 additions and 12 deletions

View File

@ -684,18 +684,12 @@ class ProjectAnalyzer
true true
); );
if ($this->project_cache_provider && $this->parser_cache_provider) { if ($this->project_cache_provider && $this->parser_cache_provider && !$is_diff) {
$removed_parser_files = $this->parser_cache_provider->deleteOldParserCaches( $removed_parser_files = $this->parser_cache_provider->deleteOldParserCaches($start_checks);
$is_diff ? $this->project_cache_provider->getLastRun(PSALM_VERSION) : $start_checks
);
if ($removed_parser_files) { if ($removed_parser_files) {
$this->progress->debug('Removed ' . $removed_parser_files . ' old parser caches' . "\n"); $this->progress->debug('Removed ' . $removed_parser_files . ' old parser caches' . "\n");
} }
if ($is_diff) {
$this->parser_cache_provider->touchParserCaches($this->getAllFiles($this->config), $start_checks);
}
} }
} }

View File

@ -746,10 +746,6 @@ class IssueBuffer
if ($project_analyzer->project_cache_provider) { if ($project_analyzer->project_cache_provider) {
$project_analyzer->project_cache_provider->processSuccessfulRun($start_time, PSALM_VERSION); $project_analyzer->project_cache_provider->processSuccessfulRun($start_time, PSALM_VERSION);
} }
if ($codebase->statements_provider->parser_cache_provider) {
$codebase->statements_provider->parser_cache_provider->processSuccessfulRun();
}
} }
if ($error_count if ($error_count