Skip to content

Commit a10a0f3

Browse files
committed
update deps, send start time in file operations
1 parent 26a7a47 commit a10a0f3

11 files changed

Lines changed: 51 additions & 30 deletions

File tree

Cargo.lock

Lines changed: 34 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

application/src/routes/api/servers/_server_/files/compress.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ mod post {
117117
path: PathBuf::from(&data.root),
118118
files: data.files.iter().map(PathBuf::from).collect(),
119119
destination_path: PathBuf::from(&data.root).join(archive_name),
120+
start_time: chrono::Utc::now(),
120121
progress: progress.clone(),
121122
total: total.clone(),
122123
},

application/src/routes/api/servers/_server_/files/copy.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ mod post {
172172
crate::server::filesystem::operations::FilesystemOperation::Copy {
173173
path: path.clone(),
174174
destination_path: file_name,
175+
start_time: chrono::Utc::now(),
175176
progress: progress.clone(),
176177
total: total.clone(),
177178
},

application/src/routes/api/servers/_server_/files/copy_many.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ mod post {
6767
crate::server::filesystem::operations::FilesystemOperation::CopyMany {
6868
path: PathBuf::from(&data.root),
6969
files: data.files.clone(),
70+
start_time: chrono::Utc::now(),
7071
progress: progress.clone(),
7172
total: total.clone(),
7273
},

application/src/routes/api/servers/_server_/files/copy_remote.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ mod post {
146146
files: data.files.iter().map(PathBuf::from).collect(),
147147
destination_server: data.destination_server,
148148
destination_path: PathBuf::from(&data.destination_path),
149+
start_time: chrono::Utc::now(),
149150
progress: progress.clone(),
150151
total: total.clone(),
151152
},
@@ -279,6 +280,7 @@ mod post {
279280
files: data.files.iter().map(PathBuf::from).collect(),
280281
destination_server: data.destination_server,
281282
destination_path: PathBuf::from(data.destination_path),
283+
start_time: chrono::Utc::now(),
282284
progress: progress.clone(),
283285
total: total.clone(),
284286
},
@@ -348,6 +350,7 @@ mod post {
348350
files: data.files.iter().map(PathBuf::from).collect(),
349351
destination_server: data.destination_server,
350352
destination_path: PathBuf::from(data.destination_path),
353+
start_time: chrono::Utc::now(),
351354
progress: progress.clone(),
352355
total: total.clone(),
353356
},

application/src/routes/api/servers/_server_/files/decompress.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ mod post {
108108
crate::server::filesystem::operations::FilesystemOperation::Decompress {
109109
path: source,
110110
destination_path: root.clone(),
111+
start_time: chrono::Utc::now(),
111112
progress: progress.clone(),
112113
total: total.clone(),
113114
},

application/src/routes/api/transfers/files.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ mod post {
147147
files: root_files.into_iter().map(PathBuf::from).collect(),
148148
destination_server: server.uuid,
149149
destination_path: PathBuf::from(&payload.destination_path),
150+
start_time: chrono::Utc::now(),
150151
progress: progress.clone(),
151152
total: total.clone(),
152153
},

application/src/server/filesystem/operations.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub enum FilesystemOperation {
2222
files: Vec<PathBuf>,
2323
destination_path: PathBuf,
2424

25+
start_time: chrono::DateTime<chrono::Utc>,
2526
#[serde(serialize_with = "serialize_arc")]
2627
progress: Arc<AtomicU64>,
2728
#[serde(serialize_with = "serialize_arc")]
@@ -31,6 +32,7 @@ pub enum FilesystemOperation {
3132
path: PathBuf,
3233
destination_path: PathBuf,
3334

35+
start_time: chrono::DateTime<chrono::Utc>,
3436
#[serde(serialize_with = "serialize_arc")]
3537
progress: Arc<AtomicU64>,
3638
#[serde(serialize_with = "serialize_arc")]
@@ -39,6 +41,7 @@ pub enum FilesystemOperation {
3941
Pull {
4042
destination_path: PathBuf,
4143

44+
start_time: chrono::DateTime<chrono::Utc>,
4245
#[serde(serialize_with = "serialize_arc")]
4346
progress: Arc<AtomicU64>,
4447
#[serde(serialize_with = "serialize_arc")]
@@ -48,6 +51,7 @@ pub enum FilesystemOperation {
4851
path: PathBuf,
4952
destination_path: PathBuf,
5053

54+
start_time: chrono::DateTime<chrono::Utc>,
5155
#[serde(serialize_with = "serialize_arc")]
5256
progress: Arc<AtomicU64>,
5357
#[serde(serialize_with = "serialize_arc")]
@@ -57,6 +61,7 @@ pub enum FilesystemOperation {
5761
path: PathBuf,
5862
files: Vec<crate::models::CopyFile>,
5963

64+
start_time: chrono::DateTime<chrono::Utc>,
6065
#[serde(serialize_with = "serialize_arc")]
6166
progress: Arc<AtomicU64>,
6267
#[serde(serialize_with = "serialize_arc")]
@@ -69,6 +74,7 @@ pub enum FilesystemOperation {
6974
destination_server: uuid::Uuid,
7075
destination_path: PathBuf,
7176

77+
start_time: chrono::DateTime<chrono::Utc>,
7278
#[serde(serialize_with = "serialize_arc")]
7379
progress: Arc<AtomicU64>,
7480
#[serde(serialize_with = "serialize_arc")]

application/src/server/filesystem/pull/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ impl Download {
252252
.add_operation(
253253
super::operations::FilesystemOperation::Pull {
254254
destination_path: self.destination.clone(),
255+
start_time: chrono::Utc::now(),
255256
progress: self.progress.clone(),
256257
total: Arc::new(AtomicU64::new(self.total)),
257258
},

application/src/server/filesystem/usage.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ impl DiskUsage {
136136
Some(current.space)
137137
}
138138

139-
#[tracing::instrument(skip(self))]
140139
pub fn update_size(&mut self, path: &Path, delta: SpaceDelta) {
141140
if crate::unlikely(path == Path::new("") || path == Path::new("/")) {
142141
return;
@@ -147,8 +146,6 @@ impl DiskUsage {
147146
let key = component.as_os_str().to_str().unwrap_or_default();
148147
let entry = current.upsert_entry(key);
149148

150-
tracing::debug!(?component, "applying path delta");
151-
152149
if delta.real >= 0 {
153150
entry.space.add_real(delta.real as u64);
154151
} else {

0 commit comments

Comments
 (0)