I launched a new app on Monday and it's surprisingly picked up a bit of traction. Completely unexpected as it was a weekend build.
Anyway I keep getting the above error (too many connections). I'm wondering if this is the issue. I had a query on the homepage that looked like this:
$rand = Product::query()->inRandomOrder()->limit(1)->first();
and that was it.
I have just now (minutes ago) changed it to:
$rand = Product::query()->inRandomOrder()->limit(1)->first(); $rand->save();
as I am completely guessing that by not having the save() method then the connection was not being closed.
Can someone verify this please as it is an absolute guess 🤓