Commit 3b62a276 authored by Ad Schellevis's avatar Ad Schellevis

(firmware) add session close for long running api action

parent c2087c3b
......@@ -46,6 +46,14 @@ class ApiControllerBase extends Controller
$this->view->disable();
}
/**
* Wrap close session, for long running operations.
*/
protected function sessionClose()
{
session_write_close();
}
/**
* before routing event
* @param Dispatcher $dispatcher
......
......@@ -43,6 +43,7 @@ class FirmwareController extends ApiControllerBase
*/
public function statusAction()
{
$this->sessionClose(); // long running action, close session
$backend = new Backend();
$response = json_decode(trim($backend->configdRun("firmware pkgstatus")), true);
......
......@@ -106,7 +106,7 @@ class ServiceController extends ApiControllerBase
public function reconfigureAction()
{
// close session for long running action
session_write_close();
$this->sessionClose();
$mdlProxy = new Proxy();
$backend = new Backend();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment