Private
Public Access
1
0

centralize jquery && bugfix mysql auto-termination problem w/ user auth

This commit is contained in:
2016-12-18 19:51:41 +01:00
parent bcc9671895
commit 1e2a231c6c
13 changed files with 90 additions and 43 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace Mine\SeekerBundle\Periodic;
use Doctrine\DBAL\Driver\PDOException;
use Doctrine\ORM\EntityManager;
use Gos\Bundle\WebSocketBundle\Periodic\PeriodicInterface;
class MinePeriodic implements PeriodicInterface
{
private $em;
public function __construct(EntityManager $entityManager)
{
$this->em = $entityManager;
}
/**
* This function is executed every 5 seconds.
*
* For more advanced functionality, try injecting a Topic Service to perform actions on your connections every x seconds.
*/
public function tick()
{
try {
$connection = $this->em->getConnection();
if (false === $connection->ping()) {
$connection->close();
$connection->connect();
}
} catch(PDOException $ex) {
throw PDOException::class;
}
}
/**
* {@inheritdoc}
*/
public function getTimeout()
{
return 777;
}
}