Giter VIP home page Giter VIP logo

Comments (4)

sander1 avatar sander1 commented on July 1, 2024

There used to be a problem where we got back an empty page, but only sometimes. Re-requesting the page immediately didn't make it work, but waiting a few seconds and then re-request the page usually made it work just fine. I'd have to check if this is still the case.

from abc.bundle.

iBaa avatar iBaa commented on July 1, 2024

Re-requesting the page immediately didn't make it work, but waiting a few seconds and then re-request the page usually made it work just fine.

But isn't the code backward then?

        try:
                html = HTML.ElementFromURL(url, sleep=5.0)
        except:
                html = HTML.ElementFromURL(url, cacheTime=0)

This "sleeps" up to 5sec before sending out the request - if another one was made just prior. Then, if an error occurred re-requests the page again, right?

With my understanding of you explanation you would request a page - and if it comes back empty re-request again after a 5sec waiting period. But this would look like...

        try:
                html = HTML.ElementFromURL(url)
        except:
                html = HTML.ElementFromURL(url, cacheTime=0, sleep=5.0)

Or do I get the ElementFromURL() wrong?

from abc.bundle.

sander1 avatar sander1 commented on July 1, 2024

The sleep will take place after the http request, and only if we do not grab the data from cache.
http://dev.plexapp.com/docs/api/networkkit.html?highlight=sleep#http
Since we do not know if we will get back any usable data, we always have to do this pause.

from abc.bundle.

iBaa avatar iBaa commented on July 1, 2024

Ah... got it - the laggy response is actually caused by the request BEFORE, essentially stopping operation for the next 5sec. I still would prefer a smaller timeout - if feasible, that is. :-)

from abc.bundle.

Related Issues (15)

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.