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

[BUG] everyTwoMinutes always run #32

Closed
plonknimbuzz opened this issue Aug 22, 2022 · 2 comments
Closed

[BUG] everyTwoMinutes always run #32

plonknimbuzz opened this issue Aug 22, 2022 · 2 comments

Comments

@plonknimbuzz
Copy link

OS: windows 10
PHP: 7.4

"lavary/crunz": "^3.2" vs "crunzphp/crunz": "^3.3"

$task->everyTwoMinutes(); or $task->cron('*/2 * * * *');

what i'm doing is running ./vendor/bin/crunz schedule:run repeatly

lavary : run as expected No event is due!
crunzphp: always run / execute task. No difference behaviour between everyMinute vs everyTwoMinutes

i'm also confirm that this bug is not happend for $task->everyThreeMinutes() or $task->cron('*/3 * * * *');

@PabloKowalczyk
Copy link
Member

Hello, let's assume we have this task file:

<?php

use Crunz\Schedule;

$scheduler = new Schedule();
$scheduler
    ->run('php -v')
    ->description('PHP version')
    ->everyTwoMinutes()
;

return $scheduler;

Now, let's see example run dates from ./crunz task:debug 1:

+----------------------+-----------------------------------+
| Example run dates                                        |
| #1                   | 2022-08-28 06:38:00 Europe/Warsaw |
| #2                   | 2022-08-28 06:40:00 Europe/Warsaw |
| #3                   | 2022-08-28 06:42:00 Europe/Warsaw |
| #4                   | 2022-08-28 06:44:00 Europe/Warsaw |
| #5                   | 2022-08-28 06:46:00 Europe/Warsaw |
+----------------------+-----------------------------------+

And here is the thing, if you run ./crunz schedule:run (multiple times) on 06:42 it will run (multiple times), but on 06:43 it won't run.
Crunz assumes it is run by Cron, every minute and in that scenario everything works as expected. Is there any use case for running Crunz multiple times in same minute?

@PabloKowalczyk
Copy link
Member

I'm closing because of inactivity.

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

2 participants