Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 16... Línea 16...
16
 
16
 
Línea 17... Línea 17...
17
declare(strict_types=1);
17
declare(strict_types=1);
Línea -... Línea 18...
-
 
18
 
18
 
19
namespace core_reportbuilder\task;
19
namespace core_reportbuilder\task;
20
 
20
 
21
use core\{clock, di};
Línea 21... Línea 22...
21
use core\task\scheduled_task;
22
use core\task\scheduled_task;
Línea 44... Línea 45...
44
     * Execute the task, request all pending schedules to be sent
45
     * Execute the task, request all pending schedules to be sent
45
     */
46
     */
46
    public function execute(): void {
47
    public function execute(): void {
47
        global $DB;
48
        global $DB;
Línea 48... Línea 49...
48
 
49
 
-
 
50
        $schedules = model::get_records_select('enabled = 1 AND timenextsend <= :time', [
-
 
51
            'time' => di::get(clock::class)->time(),
49
        $schedules = model::get_records_select('enabled = 1 AND timenextsend <= :time', ['time' => time()]);
52
        ]);
Línea 50... Línea 53...
50
        $schedules = array_filter($schedules, [schedule::class, 'should_send_schedule']);
53
        $schedules = array_filter($schedules, [schedule::class, 'should_send_schedule']);
51
 
54
 
52
        // Loop over all schedules for sending, execute corresponding task to send each individually.
55
        // Loop over all schedules for sending, execute corresponding task to send each individually.