crunzphp / crunz

A PHP-based job scheduler
MIT License
176 stars 16 forks source link

Task activity status #69

Open remitmaster opened 10 months ago

remitmaster commented 10 months ago

Hi

Description
Sometimes you need to pause a task, and it would be nice if you could set a status for tasks.

And so on, it would be good to think Also display the "Status" column in the schedule:list table

Example

use Crunz\Schedule;

$scheduler = new Schedule();
$task = $scheduler->run('command/to/execute');
$task
    ->description('Task description')
    ->in('path/to/your/command')
    ->preventOverlapping()
    ->everyThirtyMinutes()
    ->weekdays()

    ->setStatusPause() //  Set status
;

return $scheduler;
PabloKowalczyk commented 10 months ago

Hello, what is your use case?

remitmaster commented 10 months ago

Hello, sometimes you just need to pause the task for a while. Now either rename the file or remove the code in the task. It would be more convenient to simply display the status.

PabloKowalczyk commented 10 months ago

But changing status will also require code change, so what is a gain?

remitmaster commented 10 months ago

But changing status will also require code change, so what is a gain?

More convenient and beautiful. Also display the "Status" column in the schedule:list table

use Crunz\Schedule;

/*
$scheduler = new Schedule();
$task = $scheduler->run('command/to/execute');
$task
    ->description('Task description')
    ->in('path/to/your/command')
    ->preventOverlapping()
    ->everyThirtyMinutes()
    ->weekdays();

return $scheduler;
*/

or

use Crunz\Schedule;

$scheduler = new Schedule();
$task = $scheduler->run('command/to/execute');
$task
    ->description('Task description')
    ->in('path/to/your/command')
    ->preventOverlapping()
    ->everyThirtyMinutes()
    ->weekdays()

    ->setStatusPause() //  Set status
;

return $scheduler;

I would use :)

PabloKowalczyk commented 10 months ago

Would you consider sponsoring (financially) this feature?

remitmaster commented 10 months ago

Would you consider sponsoring (financially) this feature?

No, but I can try to implement it myself