Git Product home page Git Product logo

Comments (3)

Artiom-M avatar Artiom-M commented on August 19, 2024

I would suggest to put
await asyncio.sleep(5)
just after sync in order to control the frequency of syncs.
Is there anything like this during sync_forever call?

from nio-template.

anoadragon453 avatar anoadragon453 commented on August 19, 2024

Thanks for pointing this out and a workaround. I too have noticed rather large CPU usage increases on my homeserver from bots using this template.

Regarding the wait, /sync requests are how bots get messags. I don't want to impose an artificial 5s delay into every response from the bot. That would make it appear quite slow.

Matrix clients already sync as often as they can. The problem here is that we're using full_state=True, which means a matrix homeserver will answer the request immediately, even if there are 0 items to return to the client. Normally with matrix clients, the request is only completed once there is a message for the client to receive.

However, nio seems to inconsistently return messages if full_state=False, so it looks like this may be an upstream bug. I'll try to chat to poljar and see if there's something we can do here.

from nio-template.

anoadragon453 avatar anoadragon453 commented on August 19, 2024

Fixed in 1eacb29

from nio-template.

Related Issues (13)

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.