Commit c10a22bf authored by David Morley's avatar David Morley

stop bots from spinning the cpu

parent e0491bdb
...@@ -47,10 +47,12 @@ if ($domain) { ...@@ -47,10 +47,12 @@ if ($domain) {
$sql = "SELECT domain,pingdomurl,score,datecreated,weight FROM pods WHERE domain = $1"; $sql = "SELECT domain,pingdomurl,score,datecreated,weight FROM pods WHERE domain = $1";
$sleep = '0'; $sleep = '0';
$result = pg_query_params($dbh, $sql, [$domain]); $result = pg_query_params($dbh, $sql, [$domain]);
} else { } elseif (php_sapi_name() == "cli") {
$sql = 'SELECT domain,pingdomurl,score,datecreated,adminrating,weight FROM pods'; $sql = 'SELECT domain,pingdomurl,score,datecreated,adminrating,weight FROM pods';
$sleep = '1'; $sleep = '1';
$result = pg_query($dbh, $sql); $result = pg_query($dbh, $sql);
} else {
die('No valid input');
} }
$result || die('Error in SQL query1: ' . pg_last_error()); $result || die('Error in SQL query1: ' . pg_last_error());
......
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