douweng1935 2016-10-20 10:42
浏览 26
已采纳

调用主脚本调用其他脚本的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?

  • 写回答

1条回答 默认 最新

  • doushishi6513 2016-10-23 18:48
    关注

    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!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”