MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / BatchTracker_Begin

Function BatchTracker_Begin

src/common/batch_tracker.cpp:25–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void 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
44void BatchTracker_RecordUpload(uint32_t accountId, uint32_t appId,
45 const std::string& filename,

Callers 1

HandleBeginBatchFunction · 0.85

Calls 2

MakeAppAccountKeyFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected