(type_ int, id int, value int)
| 39 | } |
| 40 | |
| 41 | func addNewRecord(type_ int, id int, value int) { |
| 42 | batchUpdateLocks[type_].Lock() |
| 43 | defer batchUpdateLocks[type_].Unlock() |
| 44 | if _, ok := batchUpdateStores[type_][id]; !ok { |
| 45 | batchUpdateStores[type_][id] = value |
| 46 | } else { |
| 47 | batchUpdateStores[type_][id] += value |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func batchUpdate() { |
| 52 | // check if there's any data to update |
no outgoing calls
no test coverage detected