cococool
cococool

Reputation: 61

laravel 4 close database connection

I'm new in laravel. I just create application using this framework. My application is web scraping, so it can take a minute to complete a request. The problem is each request executed one after another. I think this is because the database connection still open until the request finished. So how to close the database connection?

Upvotes: 0

Views: 2579

Answers (2)

Krimson
Krimson

Reputation: 7664

I know this is late but you can do:

DB::disconnect('DataBase');

Upvotes: 1

cococool
cococool

Reputation: 61

OK. I just debugging my code and got that the problem is in session driver. I change session driver from native to cookie and the request not waiting other request anymore.

Upvotes: 0

Related Questions