douwei1904 2018-11-28 07:32
浏览 46

定期检查从Laravel的第三方应用程序发布的数据

3rd Party application posts regular/triggered updates to a redis database as a list.

Laravel application needs to periodically check in the redis and if there's data, further processing will be done. Can someone suggest the best way of doing this in laravel (5.7*).

  • 写回答

1条回答 默认 最新

  • douyi2107 2018-11-28 10:42
    关注

    I would recommend creating a command and using the task scheduler. Laravel already has included a way to connect your application to Redis.

    You can find more information about the task scheduler in the Laravel documentation on task scheduling. Please note that you have to add the scheduler to your server's cronlist. Laravel also provides documentation about their Redis implementation.

    Sidenote: As task scheduling can lead to certain instabilities, especially if your server has had some downtime and you have to check the database at a certain set time, I would recommend considering using a webhook to trigger Laravel checking the Redis-database. Using a multi-server environment also becomes a lot less painful this way.

    评论

报告相同问题?

悬赏问题

  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能