We need to optimize the syncing of Gmail Threads into ERP, and improve handling of Rate Limit errors.
- Disable syncing of
CHAT and DRAFT label:
- We found out that if someone enables the CHAT label for syncing, it returns an 404 error. So we need to hide the
CHAT label from the child table.
- In some threads, if there is a
DRAFT message, it leads to an error.
- Optimize requests to Google API:
- Reduce Rate-limit Errors:
- For this, we are considering executing each batch request in a separate RQ Job. This will divide our syncing process in smaller jobs, thus enabling a more robust rate-limit handling. In the event of an rate limit error, we can use Redis to store the value of
Retry-After, and allow the next batch request to be processed after that only.
- Limit number of threads to Sync:
- In my case, I was able to sync around 750 threads in a time of 6 minutes. Should we implement a limit on how many maximum threads we can sync per label? If yes, we can store the Hard Limit value in
Google Settings doctype under the Gmail Threads section.
cc @KanchanChauhan @niraj2477 @dhsathiya
We need to optimize the syncing of Gmail Threads into ERP, and improve handling of Rate Limit errors.
CHATandDRAFTlabel:CHATlabel from the child table.DRAFTmessage, it leads to an error.Retry-After, and allow the next batch request to be processed after that only.Google Settingsdoctype under theGmail Threadssection.cc @KanchanChauhan @niraj2477 @dhsathiya