Skip to content

Commit

Permalink
- Invalidate all the database session when the daemon is launched
Browse files Browse the repository at this point in the history
- Launch the childprocess using exec (see symfony/symfony#5759)
  • Loading branch information
edhelas committed Nov 26, 2014
1 parent a6b4ac9 commit 45c0928
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions app/models/sessionx/SessionxDAO.php
Expand Up @@ -248,6 +248,18 @@ function delete($session) {
$this->run('Sessionx');
}*/
function clear() {
$this->_sql = '
truncate table sessionx';

$this->prepare(
'Sessionx',
array(
)
);

$this->run('Sessionx');
}

function getAll() {
$this->_sql = '
Expand Down
3 changes: 3 additions & 0 deletions src/Movim/Daemon/Core.php
Expand Up @@ -21,6 +21,9 @@ public function __construct($loop, $baseuri, $port)
$this->loop = $loop;
$this->baseuri = $baseuri;

$sd = new \Modl\SessionxDAO();
$sd->clear();

$this->registerCleaner();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Movim/Daemon/Session.php
Expand Up @@ -46,7 +46,7 @@ private function register($loop, $me)

// Launching the linker
$this->process = new \React\ChildProcess\Process(
'php linker.php',
'exec php linker.php',
null,
array(
'sid' => $this->sid,
Expand Down

0 comments on commit 45c0928

Please sign in to comment.