Results 1 to 2 of 2

Thread: Scheduller problem

  1. #1
    spaval is offline Junior Member
    Join Date
    Jul 2009
    Posts
    2

    Default Scheduller problem

    Hi all,

    I'm trying to create a new job for a SugarCRM CE 5.3.0e system (LAMP stack). While testing the new job I observed that all the jobs are fired every minute no matter what the schedule was set to. I attached a screenshot of one of the default jobs. For this particular job the behavior is even stranger some time is fired every minute and suddenly is going to work normally.

    I tried to search on forums but had no luck finding this kind of problem. Any suggestion on how to fix this is appreciated.

    Thanks for your help.

    --Silviu
    Attached Images Attached Images  

  2. #2
    spaval is offline Junior Member
    Join Date
    Jul 2009
    Posts
    2

    Default Re: Scheduller problem

    I found the problem to be a bug present in modules/Schedulers/Scheduler.php in function deriveDBDateTimes

    The last part of this function is checking (or is supposed to check) if last job run failed and should rerun the job if "Execute if missed" is set. That piece of code is failing in this scenario:

    - Assume I scheduled a job to run once a day with "Execute if missed" checked.
    - Looking at the attached code, validJobTimes array will contain only one value which will always be a future run time
    - $focus->last_run is always in past, assuming the job run at least once
    - the test, stroked in red in attached picture, will always pass so my job will run every one minute disregarding the actual schedule

    The above behavior happens only after the first run of the job takes place, so first run will be done at a correct time but after that the job will run every minute.

    As a fast work around I just unchecked "Execute if missed" check box and now the job is working fine on intended scheduled times.
    Attached Images Attached Images  

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 2005-06-07, 01:42 AM

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
  •