Cron doesn`t run controller method

46 views
Skip to first unread message

Zenko

unread,
Sep 2, 2024, 10:22:00 AM9/2/24
to Fat-Free Framework
Hello my Fat Free version is
    "bcosca/fatfree-core": "^3.8"

And I`m trying to send mail with cron letter by letter in the loop.
Before started, I downloaded cron.php from here https://github.com/xfra35/f3-cron/tree/master
And puted it to vendor/fatfree-core directory:
cron.png

Here is my config.ini:

[CRON]
log = TRUE
web = FALSE
silent = FALSE
binary = php

[CRON.presets]
every-3-min = */3 * * * *


And here is my index.php
$fw->config($config_path);
$cron = Cron::instance();

$cron->set('Mail_send_job', 'Main_Controller->sendMailAction', '@every-3-min');

So when it started by task it returns an error:
===================================
ERROR 500 - Internal Server Error
Invalid class Main_Controller

[D:/Programs/WebSrv/xampp/htdocs/vendor/bcosca/fatfree-core/base.php:2137]
[D:/Programs/WebSrv/xampp/htdocs/vendor/bcosca/fatfree-core/base.php:2137] user_error()
[D:/Programs/WebSrv/xampp/htdocs/vendor/bcosca/fatfree-core/cron.php:114] Base->grab()
[D:/Programs/WebSrv/xampp/htdocs/vendor/bcosca/fatfree-core/cron.php:153] Cron->execute()
[D:/Programs/WebSrv/xampp/htdocs/vendor/bcosca/fatfree-core/cron.php:167] Cron->run()
[D:/Programs/WebSrv/xampp/htdocs/vendor/bcosca/fatfree-core/base.php:2222] Cron->route()
[D:/Programs/WebSrv/xampp/htdocs/vendor/bcosca/fatfree-core/base.php:1992] Base->call()
[D:/Programs/WebSrv/xampp/htdocs/index.php:32] Base->run()

And when I trying to start it manually says:
Nothing to do

How can it be solved?
Reply all
Reply to author
Forward
0 new messages