| 23 | } |
| 24 | |
| 25 | void BatchTracker_Begin(uint32_t accountId, uint32_t appId, uint64_t batchId, uint64_t assignedCN, uint64_t appBuildId, |
| 26 | int declaredUploads, int declaredDeletes) { |
| 27 | uint64_t key = MakeAppAccountKey(accountId, appId); |
| 28 | std::lock_guard<std::mutex> lock(g_uploadBatchMutex); |
| 29 | if (g_activeUploadBatches.find(key) != g_activeUploadBatches.end()) { |
| 30 | LOG("[BatchTracker] BeginBatch: replacing stale batch %llu with %llu for account %u app %u", |
| 31 | (unsigned long long)g_activeUploadBatches[key].batchId, (unsigned long long)batchId, |
| 32 | accountId, appId); |
| 33 | g_activeUploadBatches.erase(key); |
| 34 | } |
| 35 | UploadBatchState state; |
| 36 | state.batchId = batchId; |
| 37 | state.assignedCN = assignedCN; |
| 38 | state.appBuildId = appBuildId; |
| 39 | state.declaredUploads = declaredUploads; |
| 40 | state.declaredDeletes = declaredDeletes; |
| 41 | g_activeUploadBatches[key] = std::move(state); |
| 42 | } |
| 43 | |
| 44 | void BatchTracker_RecordUpload(uint32_t accountId, uint32_t appId, |
| 45 | const std::string& filename, |
no test coverage detected