search

Home  >  Q&A  >  body text

node.js - express,10次请求之后,status就pending了

PHP中文网PHP中文网2782 days ago580

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-17 16:25:30

    You can try adding a timestamp after the request http://www.ajax.com?t=111

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 16:25:30

    I have been testing this problem for a long time. Finally, with the help of a friend, I found the cause of the error. The database connection is not closed. As for why it was 10 times, I'm not sure. I hope someone who knows can tell me. Thank you

     connection.query($sql.search, [start,end,date], function(err, result) {
        res.render('result',{result:'null',user:'',date1:date1,date2:date2,date3:date3,start:start,end:end,temp:temp});
    });
    在后面加上connection.release();就行了。

    reply
    0
  • Cancelreply