You are here

function hosting_cron_get_sites in Hosting 5

Same name and namespace in other branches
  1. 6.2 cron/hosting_cron.module \hosting_cron_get_sites()
1 call to hosting_cron_get_sites()
hosting_cron_queue in cron/hosting_cron.module

File

cron/hosting_cron.module, line 64

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;
}