duanjupiao4730 2013-01-25 10:31
浏览 87

PHP set_time_limit然后重置数据库更改

I have an API which is used by a mobile app to create user profiles. It seems that occasionally the app is timing out and displays an error message but the server continues to create the profile. The result is that we have a few duplicate profiles.

I'm thinking that, as a 'quick fix' that doesn't require a complete re-architecture I could try setting the execution time of the PHP script to match the timeout limit in the app. My question is, if this time limit is reached, can I somehow execute an 'undo changes to the database' script, either automatic, or one I specify?

I know I should really be looking more into why the PHP is reaching timeout limit at all (it's a couple of minutes!), but I have already tweaked bits on the server, and mostly the execution time is just a few milliseconds. There are only a few cases of the timeout occurring. For the one example I'm looking at the minute the user is based in Israel. Is the network connectivity bad in Israel? Can anyone think of anything that could cause the behaviour I'm experiencing?

  • 写回答



      相关推荐 更多相似问题


      • ¥20 求无向连通网的所有不同构的最小生成树
      • ¥15 实现0.5秒间隔的单向流水灯
      • ¥30 网络操作系统问题求解
      • ¥30 blob下载word后内容不对
      • ¥15 求用C语言数组编程(需要完整且正确的程序)
      • ¥15 前端和swagger调导出接口乱码
      • ¥20 有没有ftps服务器可以使用公钥登录的?
      • ¥20 Ffmpeg代码层面如何实现视频陪速播放
      • ¥15 用python定义函数实现功能使用列表中动漫信息
      • ¥15 unity 使用 Vuforia 导入Model target 成功后database下拉菜单不显示导入的内容