调用主脚本调用其他脚本的cron作业
I have an application that dependes on checks every 45 minutes. These checks are set up by a cron jop, that calls a url on my server. This script then execute all the checks.
These checks became very dynamic and now I'm thinking of a better solution for this..
Now I need to break these checks into multiple URLs, and call multiple files, but I don't really want to deal with cron jobs for that all the time, is it possible that I have one PHP script to asynchronously call multiple other URLs when it's executed?
My main problem is that, these checks are not simple PHP files but full on routed URLs, running on a framework (Laravel), so I can't just run php CLI calls..
How could I achieve that?
我有一个应用程序,每45分钟依赖于一次检查。 这些检查由cron jop设置,它调用我服务器上的URL。 然后该脚本执行所有检查。 p>
这些检查变得非常动态,现在我正在考虑为此提供更好的解决方案.. p>
现在 我需要将这些检查分解为多个URL,并调用多个文件,但我真的不想一直处理cron作业,是否有可能我有一个PHP脚本异步调用多个其他URL当它是 执行? p>
我的主要问题是,这些检查不是简单的PHP文件,而是完整的路由URL,在框架(Laravel)上运行,所以我不能只运行php CLI调用.. p>
我怎么能实现这个目标? p> div>
You could abstract all of these processes to a Job
or a Command
. This way you can still execute them individually from your controllers or you to group them all together.
Furthermore, what you're describing sounds like a textbook use case for Task scheduling
in Laravel https://laravel.com/docs/5.3/scheduling.
Hope this helps!