Comments (3)
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.
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.
Fixed in 1eacb29
from nio-template.
Related Issues (13)
- Timeout errors HOT 1
- Does not work with Synapse v1.38+
- Misleading in the way it fires `invite` events HOT 1
- Factor out YAML config file reading
- ClientConnectionError HOT 1
- Don't (try to) react to messages older than max(session creation, room join)
- Pills aren't spec compliant HOT 1
- Include an message when bot doesn't support encrypted rooms but is in one
- If e2e dependencies are not installed, login will fail with Error logging in: No store class was provided in the config. HOT 6
- Add docs for installing encryption deps and enabling encryption HOT 3
- Add quickstart guide HOT 4
- Add testing examples
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nio-template.