Giter Club home page Giter Club logo

crontab's People

Contributors

walkor avatar wedrix avatar xiasf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

crontab's Issues

How to execute multiple crontab inside onWorkerStart .

$crontab_worker->onWorkerStart = function ($crontab_worker) use ($app) {
    new Crontab('0 0 * * *',    $app->boot('/article/sitemap/main'),'sitemap');
    new Crontab('*/15 * * * *', $app->boot('/multimedia/migration'),'migration_image');
    new Crontab('*/19 * * * *', $app->boot('/article/migration'),'migration_article');
};

as you can see, if we execute multiple crontabs there, the memory usage keeps increasing. I am not sure if it's the right way to execute multiple crontab all at once.

Snipaste_2023-12-27_20-16-54

请解惑一下,这是php进程阻塞引起的吗,不支持异步执行多个任务吗?

new两个Crontab() ,第一个每分钟第一秒执行,第二个每分钟第二秒执行,如果第一个执行sleep70秒,那么在第五秒的时候好像触发不到第二个任务,或者说,触发了,但是没能执行到,要等70秒后才会执行。这是Windows下php的问题吗?

$worker->onWorkerStart = function () {
// Execute the function in the first second of every minute.
new Crontab('1 * * * * *', function(){
echo "[1]start:".date('Y-m-d H:i:s')."\n";
sleep(70);
echo "[1]end:".date('Y-m-d H:i:s')."\n";
});
new Crontab('2 * * * * *', function(){
echo "[2]start:".date('Y-m-d H:i:s')."\n";
sleep(70);
echo "[2]end:".date('Y-m-d H:i:s')."\n";
});
};

运行:
[1]start:2022-07-02 17:15:01
[1]end:2022-07-02 17:16:11
[2]start:2022-07-02 17:16:11
[2]end:2022-07-02 17:17:21

crontab 进程

请问这个定时任务是单进程,会造成阻塞的吗?
如果有多个crontab想要从数据库取出配置,并且可以独立不造成阻塞 怎么做必要好。

php版本问题

1.composer.json中标记为"php": ">=5.4"即可,导致php版本5.6 5.4 5.5可以直接安装,而您写的start.php会报错,因为crontab的解析类语法是>=7.0 例如 string xxx int xxx function():bool
2.如果要是只支持7.0,那么需要修改composer.json ,如果需要支持>=5.4,还需要修改,我看到这个问题,不知道应该如何修复并提交上来

crontab 语法解析bug

eg: * * 7-10/1 * * *

当尝试设置指定时间段内执行的定时任务,比如7-10点之间,该语法解析结果为[0,1,2,3,4,5,6,7,8,9,10]。

正常解析结果:[7,8,9,10]

看了下hyperf的源码,应该是最新的代码未同步

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.