add site_type to queries, first few - several more to go.
This commit is contained in:
parent
edbcba6f11
commit
dbeae16dc1
@ -25,8 +25,9 @@ function checksites_run($argv, $argc){
|
|||||||
if($days < 1)
|
if($days < 1)
|
||||||
$days = 30;
|
$days = 30;
|
||||||
|
|
||||||
$r = q("select * from site where site_dead = 0 and site_update < %s - INTERVAL %s $sql_options ",
|
$r = q("select * from site where site_dead = 0 and site_update < %s - INTERVAL %s and site_type = %d $sql_options ",
|
||||||
db_utcnow(), db_quoteinterval($days . ' DAY')
|
db_utcnow(), db_quoteinterval($days . ' DAY'),
|
||||||
|
intval(SITE_TYPE_ZOT)
|
||||||
);
|
);
|
||||||
|
|
||||||
if(! $r)
|
if(! $r)
|
||||||
|
@ -28,9 +28,10 @@ function externals_run($argv, $argc){
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$randfunc = db_getfunc('RAND');
|
$randfunc = db_getfunc('RAND');
|
||||||
$r = q("select site_url, site_pull from site where site_url != '%s' and site_flags != %d order by $randfunc limit 1",
|
$r = q("select site_url, site_pull from site where site_url != '%s' and site_flags != %d and site_type = %d order by $randfunc limit 1",
|
||||||
dbesc(z_root()),
|
dbesc(z_root()),
|
||||||
intval(DIRECTORY_MODE_STANDALONE)
|
intval(DIRECTORY_MODE_STANDALONE),
|
||||||
|
intval(SITE_TYPE_ZOT)
|
||||||
);
|
);
|
||||||
if($r)
|
if($r)
|
||||||
$url = $r[0]['site_url'];
|
$url = $r[0]['site_url'];
|
||||||
|
@ -16,7 +16,9 @@ function is_matrix_url($url) {
|
|||||||
|
|
||||||
function prune_hub_reinstalls() {
|
function prune_hub_reinstalls() {
|
||||||
|
|
||||||
$r = q("select site_url from site where true");
|
$r = q("select site_url from site where site_type = %d",
|
||||||
|
intval(SITE_TYPE_ZOT)
|
||||||
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
foreach($r as $rr) {
|
foreach($r as $rr) {
|
||||||
$x = q("select count(*) as t, hubloc_sitekey, max(hubloc_connected) as c from hubloc where hubloc_url = '%s' group by hubloc_sitekey order by c",
|
$x = q("select count(*) as t, hubloc_sitekey, max(hubloc_connected) as c from hubloc where hubloc_url = '%s' group by hubloc_sitekey order by c",
|
||||||
|
Reference in New Issue
Block a user