作者:安韦苇8 | 来源:互联网 | 2023-07-25 13:00
When trying to connect on a "stale" connection on my development laptop, i.e. after the laptop has gone to sleep and been woken back up an hour later or so, I get the following error:
Failed to connect to: oceanic.mongohq.com:10000: Remote server has closed the connection.
This occurs on line 132 of /vagrant/vendor/jenssegers/mongodb/src/Jenssegers/Mongodb/Connection.php:
1
| return new MongoClient($dsn, $options); |
I'm wondering if this is due to a cached connection not being cleared out. Could Laravel-MongoDB check for this, and create a new connection if the cached connection is no longer valid, or is this something at the driver level that is beyond the scope of this package?
My work-around right now is to halt vagrant and start it back up.
Thoughts?
该提问来源于开源项目:jenssegers/laravel-mongodb
I did not see this issue on desktop machines or servers at all yet. I believe it has to do with how the MBP goes to sleep. I have not had this issue using Laravel Homestead on my Mac mini or Laravel Forge on DigitalOcean.