• <legend id='fTToy'><style id='fTToy'><dir id='fTToy'><q id='fTToy'></q></dir></style></legend><tfoot id='fTToy'></tfoot>

    • <bdo id='fTToy'></bdo><ul id='fTToy'></ul>

    <i id='fTToy'><tr id='fTToy'><dt id='fTToy'><q id='fTToy'><span id='fTToy'><b id='fTToy'><form id='fTToy'><ins id='fTToy'></ins><ul id='fTToy'></ul><sub id='fTToy'></sub></form><legend id='fTToy'></legend><bdo id='fTToy'><pre id='fTToy'><center id='fTToy'></center></pre></bdo></b><th id='fTToy'></th></span></q></dt></tr></i><div id='fTToy'><tfoot id='fTToy'></tfoot><dl id='fTToy'><fieldset id='fTToy'></fieldset></dl></div>

      1. <small id='fTToy'></small><noframes id='fTToy'>

      2. 防止在 PHP 中的大请求期间超时

        时间:2023-10-12
          <tbody id='zCtE8'></tbody>

            <legend id='zCtE8'><style id='zCtE8'><dir id='zCtE8'><q id='zCtE8'></q></dir></style></legend>
            <i id='zCtE8'><tr id='zCtE8'><dt id='zCtE8'><q id='zCtE8'><span id='zCtE8'><b id='zCtE8'><form id='zCtE8'><ins id='zCtE8'></ins><ul id='zCtE8'></ul><sub id='zCtE8'></sub></form><legend id='zCtE8'></legend><bdo id='zCtE8'><pre id='zCtE8'><center id='zCtE8'></center></pre></bdo></b><th id='zCtE8'></th></span></q></dt></tr></i><div id='zCtE8'><tfoot id='zCtE8'></tfoot><dl id='zCtE8'><fieldset id='zCtE8'></fieldset></dl></div>

            • <small id='zCtE8'></small><noframes id='zCtE8'>

                <bdo id='zCtE8'></bdo><ul id='zCtE8'></ul>
                <tfoot id='zCtE8'></tfoot>

                  本文介绍了防止在 PHP 中的大请求期间超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我向 Brightcove 服务器发出大量请求,要求对我的视频中的元数据进行批量更改.似乎它只通过了 1000 次迭代然后停止了 - 任何人都可以帮助调整此代码以防止发生超时吗?它需要进行大约 7000/8000 次迭代.

                  I'm making a large request to the brightcove servers to make a batch change of metadata in my videos. It seems like it only made it through 1000 iterations and then stopped - can anyone help in adjusting this code to prevent a timeout from happening? It needs to make about 7000/8000 iterations.

                  <?php
                  include 'echove.php';
                  
                  $e = new Echove(
                      'xxxxx',
                      'xxxxx'
                  );
                  
                  // Read Video IDs
                  # Define our parameters
                  $params = array(
                      'fields'         => 'id,referenceId'
                  
                  );
                  
                  # Make our API call
                  $videos = $e->findAll('video', $params);
                  
                  
                      //print_r($videos);
                      foreach ($videos as $video) {
                  
                          //print_r($video);
                          $ref_id = $video->referenceId;
                          $vid_id = $video->id;
                  
                          switch ($ref_id) {
                              case "":
                                  $metaData = array(
                                      'id' => $vid_id,
                                      'referenceId' => $vid_id
                                  );
                  
                                  # Update a video with the new meta data
                                  $e->update('video', $metaData);                
                                  echo "$vid_id updated sucessfully!<br />";
                                  break;
                              default:
                                  echo "$ref_id was not updated. <br />";
                                  break;
                          }
                      }
                  ?>
                  

                  谢谢!

                  推荐答案

                  试试 set_time_limit() 函数.调用 set_time_limit(0) 将删除执行脚本的任何时间限制.

                  Try the set_time_limit() function. Calling set_time_limit(0) will remove any time limits for execution of the script.

                  这篇关于防止在 PHP 中的大请求期间超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 PHP 中获取请求内容(正文)? 下一篇:在单个 CURL 请求中写入多个文件

                  相关文章

                  <tfoot id='tPfpH'></tfoot>

                    1. <small id='tPfpH'></small><noframes id='tPfpH'>

                      • <bdo id='tPfpH'></bdo><ul id='tPfpH'></ul>

                      <i id='tPfpH'><tr id='tPfpH'><dt id='tPfpH'><q id='tPfpH'><span id='tPfpH'><b id='tPfpH'><form id='tPfpH'><ins id='tPfpH'></ins><ul id='tPfpH'></ul><sub id='tPfpH'></sub></form><legend id='tPfpH'></legend><bdo id='tPfpH'><pre id='tPfpH'><center id='tPfpH'></center></pre></bdo></b><th id='tPfpH'></th></span></q></dt></tr></i><div id='tPfpH'><tfoot id='tPfpH'></tfoot><dl id='tPfpH'><fieldset id='tPfpH'></fieldset></dl></div>
                    2. <legend id='tPfpH'><style id='tPfpH'><dir id='tPfpH'><q id='tPfpH'></q></dir></style></legend>