encountering “Read timeout expired” error by Webhook after 60 Sec of execution

折月煮酒 提交于 2019-12-04 21:12:30

this is the code I put at the top of my scripts. it responds to telegram so they stop waiting, and the scripts continues processing.

<?php
    set_time_limit(0);
    ignore_user_abort(true);
    $out =  json_encode([
      'method'=>'sendMessage',
      'chat_id'=>$my_chat_id,
      'text'=> "Starting process..."
      ]);   
    echo $out;
    header('Connection: close');
    header('Content-Length: '.strlen($out));
    header("Content-type:application/json");
    flush();
    if (function_exists('fastcgi_finish_request')) {
        fastcgi_finish_request();
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!