SAAS-157: Automated metrics: gather info about soundcloud usage
- put DB query inside try-catch
This commit is contained in:
parent
3a6a1d8691
commit
bdf314b93a
1 changed files with 13 additions and 7 deletions
|
@ -942,6 +942,7 @@ Logging::log("getting media! - 2");
|
||||||
*/
|
*/
|
||||||
public static function getSoundCloudUploads()
|
public static function getSoundCloudUploads()
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
$con = Propel::getConnection();
|
$con = Propel::getConnection();
|
||||||
|
|
||||||
$sql = "SELECT soundcloud_id as id, soundcloud_upload_time"
|
$sql = "SELECT soundcloud_id as id, soundcloud_upload_time"
|
||||||
|
@ -951,6 +952,11 @@ Logging::log("getting media! - 2");
|
||||||
|
|
||||||
$rows = $con->query($sql)->fetchAll();
|
$rows = $con->query($sql)->fetchAll();
|
||||||
return count($rows);
|
return count($rows);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
header('HTTP/1.0 503 Service Unavailable');
|
||||||
|
Logging::log("Could not connect to database.");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue