Skip to content

Passing date will not execute the code in background  #139

@albarqx

Description

@albarqx

Hi,

When I am passing ->date() here script will not run .. once I remove ->date it will work ..

$scheduler = new Scheduler();
$scheduler->call(
function ($job) {
return "\n".date('Y-m-d H:i:s');
},
[
$job
],
'myCustomIdentifier'
)->date('2023-01-19 03:18')->output('my_test.log');
$scheduler->resetRun();
$scheduler->run();

When I print $scheduler I got this

[executionTime:GO\Job:private] => Cron\CronExpression Object

  | (
  | [cronParts:protected] => Array
  | (
  | [0] => 18
  | [1] => 03
  | [2] => 19
  | [3] => 01
  | [4] => *
  | )

[runInBackground:GO\Job:private] => 1,
[creationTime:GO\Job:private] => DateTime Object

  | (
  | [date] => 2023-01-19 03:16:22.271374
  | [timezone_type] => 3
  | [timezone] => Asia/Riyadh
  | )

but still not executed ..

If I run the script manually on this exact time then it will work ... if wait it to be done automatically then it will not ..

Did I miss something?

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