Skip to content

schedule:run -f ignores schedule's error handler #379

@drjayvee

Description

@drjayvee

Crunz version: 3.0.1

PHP version: 7.4.24

Operating system type and version: Ubuntu

Description
Force-running a schedule (schedule:run -f -t1) ignores the Schedule's error handler.

To reproduce

<?php
$sch = new Crunz\Schedule();
$sch->onError(function () {});  // will *not* be called
$sch->run(function () {};

return $sch;

Possible Solution
ScheduleRunCommand:115 seems to be the culprit. Before that section, $schedules[0] has the error handler closure. Afterwards, it's gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions