cozy / coachCO2

CoachCO2 aims to raise user awareness about their carbon footprint, notably based on their transport data.
GNU Affero General Public License v3.0
7 stars 1 forks source link

[DAT-57] [DAT-36] [DAT-48] Improve recurring service perfs #436

Closed paultranvan closed 5 months ago

paultranvan commented 5 months ago

In the recurring service, we try to match an existing contact address for each trip start/end place. When there are a lot of trips to process, this can result in many database IO and tend to make many conflicts since the few same contacts tend to be updated (e.g. myself). So instead of updating each contact for each trip, we postpone the actual db save after all the trips are processed, and deduplicate the contacts update. For example, if the myself contact has an address with 100 match, we save it once instead of 100 times.

### ✨ Features

*

### 🐛 Bug Fixes

* Minimize conflicts on recurring service 
* Minimize risks of recurring service timeout

### 🔧 Tech

*
bundlemon[bot] commented 5 months ago

BundleMon

Unchanged files (4) Status | Path | Size | Limits :------------: | ------------ | :------------: | :------------: :white_check_mark: | vendors/coachco2.(hash).js
| 1.72MB | - :white_check_mark: | app/coachco2.(hash).js
| 69.94KB | - :white_check_mark: | vendors-coachco2.(hash).(hash).min.css
| 38.69KB | - :white_check_mark: | app-coachco2.(hash).min.css
| 356B | -

No change in files bundle size

Final result: :white_check_mark:

View report in BundleMon website ➡️


Current branch size history | Target branch size history