Skip to content

Commit 229ad04

Browse files
andreacampifacebook-github-bot
authored andcommitted
Pass the CoreContext down
Summary: ## This stack I want to be able to split loading from blobstore from sending via Edenapi. The main motivation right now is benchmarking, but we might be able to optimize further. ## This diff We'll need the context down here, let's pass it down. Reviewed By: RajivTS Differential Revision: D72062552 fbshipit-source-id: 6ad2ba31d304474275ea1f922390a6e53cf78783
1 parent 7b8b2b1 commit 229ad04

File tree

1 file changed

+19
-2
lines changed
  • eden/mononoke/modern_sync/src/sender/manager

1 file changed

+19
-2
lines changed

eden/mononoke/modern_sync/src/sender/manager/content.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ impl ContentManager {
6363
}
6464

6565
async fn flush_batch(
66+
_ctx: CoreContext,
6667
content_es: &Arc<dyn EdenapiSender + Send + Sync>,
6768
current_batch: &mut Vec<ContentId>,
6869
current_batch_size: u64,
@@ -141,7 +142,15 @@ impl Manager for ContentManager {
141142
}
142143

143144
if current_batch_size >= MAX_BLOB_BYTES || current_batch.len() >= MAX_CONTENT_BATCH_SIZE {
144-
if let Err(e) = ContentManager::flush_batch(&content_es, &mut current_batch, current_batch_size, &mut pending_messages, reponame.clone(), &logger).await {
145+
if let Err(e) = ContentManager::flush_batch(
146+
ctx.clone(),
147+
&content_es,
148+
&mut current_batch,
149+
current_batch_size,
150+
&mut pending_messages,
151+
reponame.clone(),
152+
&logger,
153+
).await {
145154
error!(logger, "Error processing content: {:?}", e);
146155
return;
147156
}
@@ -150,7 +159,15 @@ impl Manager for ContentManager {
150159
}
151160
_ = flush_timer.tick() => {
152161
if current_batch_size > 0 || !pending_messages.is_empty() {
153-
if let Err(e) = ContentManager::flush_batch(&content_es, &mut current_batch, current_batch_size, &mut pending_messages, reponame.clone(), &logger).await {
162+
if let Err(e) = ContentManager::flush_batch(
163+
ctx.clone(),
164+
&content_es,
165+
&mut current_batch,
166+
current_batch_size,
167+
&mut pending_messages,
168+
reponame.clone(),
169+
&logger,
170+
).await {
154171
error!(logger, "Error processing content: {:?}", e);
155172
return;
156173
}

0 commit comments

Comments
 (0)