Closed (fixed)
Project:
Multisite Manager
Version:
5.x-0.9-4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Aug 2007 at 20:43 UTC
Updated:
10 Sep 2007 at 14:58 UTC
Jump to comment: Most recent file
Comments
Comment #1
dwarner commentedHere's a first stab at running each sub-site's cron jobs. I couldn't figure out how to only switch databases/prefixes and just call drupal_run_cron(); it seemed like drupal had the 'cron_semaphore' variable cached and wouldn't run the cron jobs for the sub-sites. Currently it's implemented as a call to each sub-site's cron.php page using drupal_http_request().
I'd like to add the feature where an admin can set the default value for whether to run sub-sites' cron jobs and add the option to each drupal site, but that will require an update script as well. Let me know what you think.
Comment #2
schuyler1d commentedThe problem with calling it through the url is that there's little likelikhood that the process will be logged in to all of the websites.
Without this fixed, it will still be difficult to use drupal_cron_run. We'll probably need a test function to see whether it's broken or not before trying to run it.
Comment #3
dwarner commentedNew patch that adds an option for running drupal sites' cron jobs globally and per-drupal-site (with update script).
I attempted to use drupal_run_cron() initially but it didn't work out well for me. I agree that calling it through the URL is definitely not the most ideal, but I'm not sure what other methods are available if drupal_run_cron() is out. You're much more familiar with switching the DBs to do the install work, so if you have any suggestions on things to try here, I'm open to suggestions.
The only thing I can think of that might help is increasing the set_time_limit() similar to what drupal_run_cron() does for each time through the loop running drupal sites' cron jobs.
Comment #4
schuyler1d commentedok, I committed your changes, fixing two bugs.
1. _multisite_manager_node_url($node) needed 'global $base_url;' to work properly
2. Your test for >=400 wasn't triggering because drupal_http_request() is too clever by half and doesn't include the response code if it's an error, so I just test for $result->error
I came around the URL method you're doing, since I realized that cron.php isn't protected by any auth. I documented this a little bit in my commit inside the hook_cron() method. You can pull from HEAD or d/l 0.9.5
Comment #5
dwarner commentedLooks good to me; thanks for merging!