nunomaduro / phpinsights

🔰 Instant PHP quality checks from your console
https://phpinsights.com
MIT License
5.28k stars 281 forks source link

I am getting timeout error. Please guide me solution. #671

Open Jaimin-Devhero opened 9 months ago

Jaimin-Devhero commented 9 months ago

I have the laravel 9 app

insight versions: "nunomaduro/phpinsights": "^2.7",

image
TanisukeGoro commented 8 months ago

@Jaimin-Devhero

I have the same issue. It's because phpinsight somehow tries to inspect more files than expected. (The progress bar in the console shows that there are over 3000 files, but only a few hundred should actually need to be inspected.) It's not an essential solution, but ./tmp/* should work around the problem for once by deleting.

$ rm -rf ./tmp/*
$ php artisan insights
TanisukeGoro commented 8 months ago

@Jaimin-Devhero In my case, the cause was found. A recent change was made in my project to output PHPStan cache to /tmp. This was generating a lot of files in /tmp and delaying the execution of phpinsights.

The way to deal with this (assuming you are using Laravel) was to specify the directory to exclude in config/insights.php where there is an 'exclude' entry.

This solved this problem.

Maybe something similar is happening :)