schedule_index_upload: remove unused Option() around metadata param

This commit is contained in:
Christian Schwarz
2022-11-11 11:55:28 -05:00
committed by Dmitry Rodionov
parent d7c120574b
commit ed28ced3bc
2 changed files with 5 additions and 7 deletions

View File

@@ -398,7 +398,7 @@ impl RemoteTimelineClient {
/// exist in remote storage, they really do.
pub fn schedule_index_upload(
self: &Arc<Self>,
metadata: Option<&TimelineMetadata>,
metadata: &TimelineMetadata,
) -> anyhow::Result<()> {
let mut upload_queue = self.upload_queue.lock().unwrap();
ensure!(
@@ -406,9 +406,7 @@ impl RemoteTimelineClient {
"upload queue not initialized"
);
if let Some(new_metadata) = metadata {
upload_queue.latest_metadata = Some(new_metadata.clone());
}
upload_queue.latest_metadata = Some(metadata.clone());
let disk_consistent_lsn = upload_queue
.latest_metadata
@@ -903,7 +901,7 @@ mod tests {
// Schedule upload of index. Check that it is queued
let metadata = dummy_metadata(Lsn(0x20));
client.schedule_index_upload(Some(&metadata))?;
client.schedule_index_upload(&metadata)?;
{
let upload_queue = client.upload_queue.lock().unwrap();
assert!(upload_queue.queued_operations.len() == 1);

View File

@@ -1192,7 +1192,7 @@ impl Timeline {
if !local_only_filenames.is_empty() {
// FIXME this we should merge local and remote metadata, at least remote_consistent_lsn
// see comment in download_missing
remote_client.schedule_index_upload(Some(&up_to_date_metadata))?;
remote_client.schedule_index_upload(&up_to_date_metadata)?;
}
info!("Done");
@@ -1765,7 +1765,7 @@ impl Timeline {
for (path, layer_metadata) in layer_paths_to_upload {
remote_client.schedule_layer_file_upload(&path, &layer_metadata)?;
}
remote_client.schedule_index_upload(Some(&metadata))?;
remote_client.schedule_index_upload(&metadata)?;
}
Ok(())