Back

The client takes time to initialise

  • 0
  • General
  • Flutter
  • Accounts
Aarush Acharya
19 Aug, 2023, 06:26

I have configured the client yet it takes a certain time for it to get initialized added a future delayed after configuration that worked but wanted a methodology that could be ideal for production level code does appwrite provide anything for this ?

TL;DR
The client takes time to initialize. Rather than initializing it on every `onInit`, it should be created once as a singleton. Use `const` to create it and use it. The `update` method's purpose is unclear, consider using `FutureBuilder` for UI updates. Slow connection could be due to daily backups. Test with Postman to see if it's also slow.
darShan
19 Aug, 2023, 08:54
  1. I don't think the client should be initialised on every onInit.I am not sure if this is GetX or something like that. In-fact the client should be created once afaik like a singleton. You could make it a const and use it, i guess?
  2. I don't know that the update method does, change UI? maybe try FutureBuilder. Since this is also a network call and you seem to on appwrite cloud, I've heard in general forum that a slow connection could be due to daily backups or something.
  3. Also, what happens if you try to use Postman or something to simulate similar network request? Is that slow too?
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more