MDL-16799 - Unit tests failing on events testing - caused by handler caching; merged from MOODLE_19_STABLE

This commit is contained in:
skodak 2008-10-06 22:07:37 +00:00
parent 969ca8b3eb
commit 779ad29f99

View File

@ -424,6 +424,8 @@ function events_trigger($eventname, $eventdata) {
// ok, queue is empty, lets reset the status back to 0 == ok
$handler->status = 0;
$DB->set_field('events_handlers', 'status', 0, array('id'=>$handler->id));
// reset static handler cache
events_get_handlers('reset');
}
}
@ -435,11 +437,15 @@ function events_trigger($eventname, $eventdata) {
}
// set error count to 1 == send next instant into cron queue
$DB->set_field('events_handlers', 'status', 1, array('id'=>$handler->id));
// reset static handler cache
events_get_handlers('reset');
} else {
// increment the error status counter
$handler->status++;
$DB->set_field('events_handlers', 'status', $handler->status, array('id'=>$handler->id));
// reset static handler cache
events_get_handlers('reset');
}
// update the failed counter