SAAS-157: Automated metrics: gather info about soundcloud usage

- put DB query inside try-catch
This commit is contained in:
denise 2012-05-07 12:12:08 -04:00
parent 3a6a1d8691
commit bdf314b93a

View file

@ -942,6 +942,7 @@ Logging::log("getting media! - 2");
*/
public static function getSoundCloudUploads()
{
try {
$con = Propel::getConnection();
$sql = "SELECT soundcloud_id as id, soundcloud_upload_time"
@ -951,6 +952,11 @@ Logging::log("getting media! - 2");
$rows = $con->query($sql)->fetchAll();
return count($rows);
} catch (Exception $e) {
header('HTTP/1.0 503 Service Unavailable');
Logging::log("Could not connect to database.");
exit;
}
}