From 779ad29f99e6891c8fc35c431f9cf8ee211d7ebb Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 6 Oct 2008 22:07:37 +0000 Subject: [PATCH] MDL-16799 - Unit tests failing on events testing - caused by handler caching; merged from MOODLE_19_STABLE --- lib/eventslib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/eventslib.php b/lib/eventslib.php index b6703eafd28..a5d95888950 100755 --- a/lib/eventslib.php +++ b/lib/eventslib.php @@ -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