Scheduler job doesn't execute my php changes

Hi,

I work with sugar pro 7.6 and I want to execute a custom job which checks the status of the contracts and does something.

I correctly setup my batch file (following the documentation instructions) for the execution of the scheduled job and the file is executed each minute.

I have created a file at this location C:\wamp\www\sugarcrm\custom\Extension\modules\Schedulers\Ext\ScheduledTasks\rinnovo_contratto.php with this lines

 

array_push($job_strings, 'rinnovo_contratto');
function rinnovo_contratto()
{
error_log("Start job",0);
$today = date("Y-m-d");
error_log("Date range start:".$today,0);
return true;
}

I have created a scheduler that execute rinnovo_contratto.php and in the detailview of the scheduler I can see a lot of execution of the job.

The problem is that, when I want to change the code in this php file and I want to test it, I can't do this. If I add some lines of codes nothing happens. I try to delete the cache, make a quick rebuild and rebuild the scheduler but nothing change.

There' s no errors in the log files that can help me to find a possible problem.

Or sugar executes the old job, or it doesn't execute the file.

Can you help me? I can't lose all this time for each update of my code.

Best regards 

Stefano

Parents
  • Have you already setup the scheduler from Admin->Scheduler for you custom scheduler?  Please make it run "as often as possible" by clicking on the Advance Options after selecting your job from the drop down list and make it was shown below:

  • I try this but nothing changes, the old lines of codes still remain in the scheduledtasks.ext.php file and they are executed by the scheduler. In the cmd terminal, when I try to execute the job, I find this:

    INIZIO: assegnamento azienda con contratto in scadenza al team rinnovi
    Date range start:2016-09-06
    Date range end:
    PHP Strict standards: Declaration of Contract::list_view_parse_additional_secti
    ons() should be compatible with SugarBean::list_view_parse_additional_sections(&
    $list_form) in C:\wamp\www\sugarcrm\modules\Contracts\Contract.php on line 437
    PHP Stack trace:
    PHP 1. {main}() C:\wamp\www\sugarcrm\cron.php:0
    PHP 2. SugarCronJobs->runCycle() C:\wamp\www\sugarcrm\cron.php:43
    PHP 3. SugarCronJobs->executeJob() C:\wamp\www\sugarcrm\include\SugarQueue\Sug
    arCronJobs.php:237
    PHP 4. SchedulersJob->runJob() C:\wamp\www\sugarcrm\include\SugarQueue\SugarCr
    onJobs.php:192
    PHP 5. call_user_func_array() C:\wamp\www\sugarcrm\modules\SchedulersJobs\Sche
    dulersJob.php:503
    PHP 6. rinnovo_contratto() C:\wamp\www\sugarcrm\modules\SchedulersJobs\Schedul
    ersJob.php:503
    PHP 7. BeanFactory::newBean() C:\wamp\www\sugarcrm\custom\modules\Schedulers\E
    xt\ScheduledTasks\scheduledtasks.ext.php:124
    PHP 8. BeanFactory::getBean() C:\wamp\www\sugarcrm\data\BeanFactory.php:203
    PHP 9. class_exists() C:\wamp\www\sugarcrm\data\BeanFactory.php:78
    PHP 10. SugarAutoLoader::autoload() C:\wamp\www\sugarcrm\data\BeanFactory.php:0


    Strict standards: Declaration of Contract::list_view_parse_additional_sections()
    should be compatible with SugarBean::list_view_parse_additional_sections(&$list
    _form) in C:\wamp\www\sugarcrm\modules\Contracts\Contract.php on line 437

    Call Stack:
    0.0004 244320 1. {main}() C:\wamp\www\sugarcrm\cron.php:0
    1.5374 45590288 2. SugarCronJobs->runCycle() C:\wamp\www\sugarcrm\cron.p
    hp:43
    6.3090 79992584 3. SugarCronJobs->executeJob() C:\wamp\www\sugarcrm\incl
    ude\SugarQueue\SugarCronJobs.php:237
    6.3090 79992584 4. SchedulersJob->runJob() C:\wamp\www\sugarcrm\include\
    SugarQueue\SugarCronJobs.php:192
    6.3097 80050336 5. call_user_func_array() C:\wamp\www\sugarcrm\modules\S
    chedulersJobs\SchedulersJob.php:503
    6.3097 80050656 6. rinnovo_contratto() C:\wamp\www\sugarcrm\modules\Sche
    dulersJobs\SchedulersJob.php:503
    6.3361 80091016 7. BeanFactory::newBean() C:\wamp\www\sugarcrm\custom\mo
    dules\Schedulers\Ext\ScheduledTasks\scheduledtasks.ext.php:124
    6.3361 80091016 8. BeanFactory::getBean() C:\wamp\www\sugarcrm\data\Bean
    Factory.php:203
    6.3362 80091832 9. class_exists() C:\wamp\www\sugarcrm\data\BeanFactory.
    php:78
    6.3362 80092152 10. SugarAutoLoader::autoload() C:\wamp\www\sugarcrm\data
    \BeanFactory.php:0

    LUNGHEZZA RESULT: 0

    This is the log of the execution of my job I think, and the error_log functions of my old code are correctly printed.

    There are also two errors due to the code, but the real problem is that the new code is not executed.

    If I manually change the code in the scheduledtasks.ext.php file and I update the relative file of the custom job this can be a solution to my problem or is a bad practice which can create other problems?

  • I guess the application server is not able to rewrite on custom/modules/Schedulers/Ext/ScheduledTasks/scheduledtasks.ext.php file. Please check the permissions to this particular file and try to run repair & rebuild.

Reply Children