Merge branch 'MDL-32338' of git://github.com/nebgor/moodle
[moodle.git] / lib / pluginlib.php
index 0dc33d0..df5239c 100644 (file)
@@ -1112,12 +1112,12 @@ class available_update_checker {
      */
     protected function cron_execute() {
 
      */
     protected function cron_execute() {
 
-        $this->restore_response();
-        $previous = $this->recentresponse;
-        $this->fetch();
-        $this->restore_response(true);
-        $current = $this->recentresponse;
         try {
         try {
+            $this->restore_response();
+            $previous = $this->recentresponse;
+            $this->fetch();
+            $this->restore_response(true);
+            $current = $this->recentresponse;
             $changes = $this->compare_responses($previous, $current);
             $notifications = $this->cron_notifications($changes);
             $this->cron_notify($notifications);
             $changes = $this->compare_responses($previous, $current);
             $notifications = $this->cron_notifications($changes);
             $this->cron_notify($notifications);