Results 1 to 6 of 6

Thread: SugarCrm 5.0 CE Scheduler not working

  1. #1
    kenneth.thorman is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    191

    Default SugarCrm 5.0 CE Scheduler not working

    Hi

    I have been browsing these forums for a while to be able to find a solution to this.

    The scheduler in CE seems broken.

    This should mean. Run me 23:30 all weekdays (not in weekends)
    30::23::*::*::1,2,3,4,5

    When I actually debug all of this I end up in the Scheduler.deriveDBDateTimes method.

    All over the place in this method there are references to $focus->dayInt, $focus->dayLabel
    These are always null. Which means that this code

    Code:
    			} else {
    				$dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $days);
    			}
    			
    			// check the day to be in scope:
    			if(!in_array($today['weekday'], $dayName)) {
    				return false;
    			}
    does not work returning flase all the time causing the job not to be executed.

    I have not checked this for month.

    Anyone?

    Thank you in advance

    Kenneth Thorman
    Last edited by kenneth.thorman; 2008-06-19 at 09:13 AM.

  2. #2
    kenneth.thorman is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    191

    Default Re: SugarCrm 5.0 CE Scheduler not working

    This was a bug in the CE version of the scheduler

    Please modify SUGARINSTALL/cron.php around line 79 to look like this

    Code:
     
    if($timestamp[0] < strtotime(date('H:i'))) {
    	if(is_writable($cachePath.'/'.$pid)) {
    		write_array_to_file('timestamp', array(strtotime(date('H:i'))) , $cachePath.'/'.$pid);
    		require_once('modules/Schedulers/Scheduler.php');
    
                    // HACK By Kenneth Thorman to allow the Scheduler to work Sugar 5.0.0e
                    require_once('include/utils.php');
                    $GLOBALS['mod_strings'] = return_module_language($current_language, "Schedulers"); 
                    // HACK By Kenneth Thorman to allow the Scheduler to work
    
    		$s = new Scheduler();        
                    $s->flushDeadJobs();
    		$s->checkPendingJobs();
    	} else {

    and then modify SUGARINSTALL/modules/Schedulers/Scheduler.php change the constructor to this

    Code:
    	function Scheduler($init=true) {
    		parent::SugarBean();
    
    		if($init) {
    			require_once('modules/Users/User.php');
    			$user = new User();
    			$user->retrieve('1'); // Scheduler jobs run as Admin
    			$this->user = $user;
                            // HACK By Kenneth Thorman to allow the Scheduler to work Sugar 5.0.0e
                            $this->setStandardArraysAttributes();
                            // HACK By Kenneth Thorman to allow the Scheduler to work Sugar 5.0.0e
    		}
     	}

  3. #3
    kenneth.thorman is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    191

    Default Re: SugarCrm 5.0 CE Scheduler not working

    This is now available with the latest version of the Appinux_Base module found here https://sourceforge.net/project/show...roup_id=210096

    PLEASE NOTE THIS MODULE CONTAINS SEVERAL NOT UPGRADE SAFE BUG FIXES AND PATCHES TO SUGARCRM, USE AT YOUR OWN RISC

    Regards
    Kenneth Thorman

  4. #4
    grohling is offline Junior Member
    Join Date
    Jun 2006
    Posts
    3

    Default Re: SugarCrm 5.0 CE Scheduler not working

    Is this only a CE problem because looking at the Pro code it would seem the same.

  5. #5
    kenneth.thorman is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    191

    Default Re: SugarCrm 5.0 CE Scheduler not working

    Hi

    I do not know to be honest, I do not have access to the Pro edition.

    The error is pretty easy to reproduce though.

    Make sure the scheduler/cron is setup correctly.

    Set the hour and time + a few minutes and then * * *

    like this (current time = 19:44)

    50 19 * * *

    Choose a job that produces something you can see, for instance sending a test email or creating a file somewhere, anything
    What for 6 minutes, if every thing is working then iyou should see your test email, new file, log line ... . If not then this bug is probably present in Pro as well


    Regards
    Kenneth Thorman

  6. #6
    kenneth.thorman is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    191

    Default Re: SugarCrm 5.0 CE Scheduler not working

    I am pretty sure that using this module on PRO and ENT editions will not work and break a lot of things, please make sure you test it properly if you do install it on any of these editions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Check Inbound Mail scheduler item fails
    By stephen.bass in forum Help
    Replies: 3
    Last Post: 2008-07-01, 09:55 PM
  2. Quick Create not working in Contacts popup
    By pniranjan in forum Developer Help
    Replies: 1
    Last Post: 2007-04-26, 01:10 PM
  3. Merge Contacts show sql error
    By hheckner in forum General Discussion
    Replies: 5
    Last Post: 2006-10-04, 01:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •