daycry / cronjob

- Manage Cron jobs in Codeigniter 4
MIT License
64 stars 20 forks source link

Cannot Run url and command list #8

Closed reactmore closed 1 year ago

reactmore commented 2 years ago

Run url $schedule->url(base_url('cron/update-sitemap'))->everyMinute();

Log Terminal :

**** Running Tasks... ****

[2022-10-13 20:43:59] Processing: url_9a7e661ea4c1c0bd748711cf68bffce7
[2022-10-13 20:44:00] Failed: url_9a7e661ea4c1c0bd748711cf68bffce7

**** Completed ****

Log :

{
        "name": "url_9a7e661ea4c1c0bd748711cf68bffce7",
        "type": "url",
        "action": "https:\/\/domain.test\/cron\/update-sitemap",
        "environment": "[]",
        "start_at": "2022-10-13 20:34:26",
        "end_at": "2022-10-13 20:34:27",
        "duration": "00:00:00",
        "output": null,
        "error": "{}",
        "test_time": null
    }

Command cronjob:list log from CLI :

[Error]

Typed property Daycry\CronJob\Job::$name must not be accessed before initialization

at VENDORPATH\daycry\cronjob\src\Job.php:172

Backtrace:
  1    VENDORPATH\daycry\cronjob\src\Commands\Lister.php:60
       Daycry\CronJob\Job()->lastRun()

  2    SYSTEMPATH\CLI\Commands.php:63
       Daycry\CronJob\Commands\Lister()->run([])

  3    SYSTEMPATH\CLI\CommandRunner.php:65
       CodeIgniter\CLI\Commands()->run('cronjob:list', [])

  4    SYSTEMPATH\CLI\CommandRunner.php:51
       CodeIgniter\CLI\CommandRunner()->index([])

  5    SYSTEMPATH\CodeIgniter.php:895
       CodeIgniter\CLI\CommandRunner()->_remap('index', [...])

  6    SYSTEMPATH\CodeIgniter.php:457
       CodeIgniter\CodeIgniter()->runController(Object(CodeIgniter\CLI\CommandRunner))

  7    SYSTEMPATH\CodeIgniter.php:336
       CodeIgniter\CodeIgniter()->handleRequest(null, Object(Config\Cache), false)

  8    SYSTEMPATH\CLI\Console.php:48
       CodeIgniter\CodeIgniter()->run()

  9    ROOTPATH\spark:98
       CodeIgniter\CLI\Console()->run()
rombyar commented 1 year ago

Try this https://stackoverflow.com/a/65487230

daycry commented 1 year ago

I will see this bug.

Thank you!

El jue, 3 nov 2022 a las 17:56, Ahmad Romadhon @.***>) escribió:

Try this https://stackoverflow.com/a/65487230

— Reply to this email directly, view it on GitHub https://github.com/daycry/cronjob/issues/8#issuecomment-1302401890, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZ5DP7UDY45ZG5XJ73G2UDWGPVDVANCNFSM6AAAAAAREJVLOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

daycry commented 1 year ago

What version of PHP do you use?

El vie, 4 nov 2022 a las 9:23, Jordi daycry @.***>) escribió:

I will see this bug.

Thank you!

El jue, 3 nov 2022 a las 17:56, Ahmad Romadhon @.***>) escribió:

Try this https://stackoverflow.com/a/65487230

— Reply to this email directly, view it on GitHub https://github.com/daycry/cronjob/issues/8#issuecomment-1302401890, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZ5DP7UDY45ZG5XJ73G2UDWGPVDVANCNFSM6AAAAAAREJVLOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

daycry commented 1 year ago

Try with v2.1.3

rombyar commented 1 year ago

What version of PHP do you use? El vie, 4 nov 2022 a las 9:23, Jordi daycry @.>) escribió: I will see this bug. Thank you! El jue, 3 nov 2022 a las 17:56, Ahmad Romadhon @.>) escribió: > Try this https://stackoverflow.com/a/65487230 > > — > Reply to this email directly, view it on GitHub > <#8 (comment)>, or > unsubscribe > https://github.com/notifications/unsubscribe-auth/ABZ5DP7UDY45ZG5XJ73G2UDWGPVDVANCNFSM6AAAAAAREJVLOI > . > You are receiving this because you are subscribed to this thread.Message > ID: @.***> >

I use PHP 7.4 on live server.

daycry commented 1 year ago

Is solved the issue?

reactmore commented 1 year ago

Solve on PHP 8 thanks