phpinsights icon indicating copy to clipboard operation
phpinsights copied to clipboard

I am getting timeout error. Please guide me solution.

Open Jaimin-Devhero opened this issue 2 years ago • 2 comments

I have the laravel 9 app

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

image

Jaimin-Devhero avatar Jan 09 '24 10:01 Jaimin-Devhero

@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 avatar Jan 13 '24 08:01 TanisukeGoro

@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 :)

TanisukeGoro avatar Jan 13 '24 10:01 TanisukeGoro