Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 182... Línea 182...
182
                forum_tp_mark_posts_read($this->recipient, array_keys($markposts));
182
                forum_tp_mark_posts_read($this->recipient, array_keys($markposts));
183
                $this->log_finish("Marked {$count} posts as read");
183
                $this->log_finish("Marked {$count} posts as read");
184
            }
184
            }
185
        }
185
        }
Línea 186... Línea 186...
186
 
186
 
187
        if ($errorcount > 0 and $sentcount === 0) {
187
        if ($errorcount > 0 && $sentcount === 0) {
-
 
188
            // All messages errored. So fail.
-
 
189
            // Checking if the task failed because of empty email address so that it doesn't get rescheduled.
188
            // All messages errored. So fail.
190
            if (!empty($this->recipient->email)) {
-
 
191
                throw new \moodle_exception('Error sending posts.');
-
 
192
            } else {
-
 
193
                mtrace("Failed to send emails for the user with ID ".
-
 
194
                    $this->recipient->id ." due to an empty email address. Skipping re-queuing of the task.");
189
            throw new \moodle_exception('Error sending posts.');
195
            }
190
        } else if ($errorcount > 0) {
196
        } else if ($errorcount > 0) {
191
            // Requeue failed messages as a new task.
197
            // Requeue failed messages as a new task.
192
            $task = new send_user_notifications();
198
            $task = new send_user_notifications();
193
            $task->set_userid($this->recipient->id);
199
            $task->set_userid($this->recipient->id);