Coder Social home page Coder Social logo

movie插件经常超时 about slack_bot HOT 5 CLOSED

python-cn avatar python-cn commented on July 17, 2024
movie插件经常超时

from slack_bot.

Comments (5)

dongweiming avatar dongweiming commented on July 17, 2024

movie超时的主要原因是豆瓣电影的图片做了防盗链的策略, 不能直接在slack里面显示, 所以我的做法是,下载图片, 把它传到slack的文件服务器上, 然后获得返回的url. 大部分的时间都浪费在下载和上传图片的时候.

我当时研究过改这个超时, 但是没有找到对应的设置方式

from slack_bot.

halfcrazy avatar halfcrazy commented on July 17, 2024

@firemiles @dongweiming 如果是heroku那边的超时,参考 https://devcenter.heroku.com/articles/request-timeout 这里有说明可以设置超时时间

或者在flask-slackbot这层,加一个handle超时处理的支持

from slack_bot.

dongweiming avatar dongweiming commented on July 17, 2024

@halfcrazy 你说的这个页面没有对我们这种环境的配置

from slack_bot.

halfcrazy avatar halfcrazy commented on July 17, 2024

@dongweiming PROC文件web: gunicorn wsgi:app --timeout 240 --log-file -这里的--timeout 240,在heroku上是没用的,最大是30s,也就是默认的timeout。

By default, Gunicorn gracefully restarts a worker if hasn’t completed any work within the last 30 seconds.

from slack_bot.

dongweiming avatar dongweiming commented on July 17, 2024

我后来给heroku的帮助中心发了邮件, 问怎么修改. 它们给的回复是没法修改, 我们只能自己优化解决.

Hi,

30s timeout is Heroku router level timeout, so you can't use anything longer even though it's technically >configurable with Gunicorn (and I think your Gunicorn is actually using your timeout, but the response >just doesn't reach to the client because Heroku router already made a response with H12 errors). You'll >see H12 errors for any requests that take more than 30s as Steven explained, it's a hard limit of Heroku >platform and we can't extend this, unfortunately.

If you expect the request to be more than 30s, you'll need to optimize it or find some workaround.

Best,
Keiko

from slack_bot.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.