Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing date will not execute the code in background #139

Open
albarqx opened this issue Jan 19, 2023 · 0 comments
Open

Passing date will not execute the code in background #139

albarqx opened this issue Jan 19, 2023 · 0 comments

Comments

@albarqx
Copy link

albarqx commented Jan 19, 2023

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?

@albarqx albarqx changed the title ->date Passing date will not execute the code in background Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant