function hosting_cron_get_sites in Hostmaster (Aegir) 6
Get a number of sites that need to have cron executed.
Parameters
$limit: Limit to a maximum of this number of sites.
Return value
An array of site nodes that need to have cron executed.
Deprecated
function unused
File
- modules/
hosting/ cron/ hosting_cron.module, line 94 - Allow the hosting system to cron all the installed sites on a schedule.
Code
function hosting_cron_get_sites($limit = 5) {
$result = db_query("SELECT n.nid FROM {node} n LEFT JOIN {hosting_site} s ON n.nid=s.nid WHERE n.type='site' and s.status = %d ORDER BY s.last_cron ASC, n.nid ASC limit %d", HOSTING_SITE_ENABLED, $limit);
while ($nid = db_fetch_object($result)) {
$sites[$nid->nid] = node_load($nid->nid);
}
return $sites;
}