Skip to content

Commit 444485a

Browse files
authored
added IP address to ping worker message (#36)
* added IP address to ping worker message * clippy * clippy
1 parent c01d04b commit 444485a

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

rabbitmq/src/messages.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ pub struct PingResult {
6262
pub min: f64,
6363
pub max: f64,
6464
pub avg: f64,
65+
pub ip_address: String,
6566
}
6667

6768
#[derive(Serialize, Deserialize, Debug, Clone)]

scheduler/src/repository/job_repository.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pub struct SubJobWithData {
5959
pub worker_data: Vec<WorkerData>,
6060
}
6161

62+
#[allow(dead_code)]
6263
#[derive(Serialize, Deserialize, FromRow, Debug, Type, ToSchema, Clone)]
6364
pub struct WorkerData {
6465
pub id: Uuid,
@@ -69,6 +70,7 @@ pub struct WorkerData {
6970
pub head: serde_json::Value,
7071
}
7172

73+
#[allow(dead_code)]
7274
#[derive(Serialize, Deserialize, FromRow, Debug, Type)]
7375
pub struct WorkerDataDownload {
7476
end_time: DateTime<Utc>,
@@ -81,6 +83,7 @@ pub struct WorkerDataDownload {
8183
second_by_second_logs: Option<serde_json::Value>,
8284
}
8385

86+
#[allow(dead_code)]
8487
#[derive(Serialize, Deserialize, FromRow, Debug, Type)]
8588
pub struct WorkerDataError {
8689
error: String,

scheduler/src/repository/sub_job_repository.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub struct SubJobWithJob {
5858
pub job: Json<Job>,
5959
}
6060

61+
#[allow(dead_code)]
6162
#[derive(Debug, Serialize, Deserialize, Type)]
6263
pub struct WorkerData {
6364
id: Uuid,

worker/src/handlers/ping.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,6 @@ pub async fn process(job_id: Uuid, payload: JobMessage) -> Result<PingResult, Pi
9797
avg: avg_latency,
9898
min: min_latency,
9999
max: max_latency,
100+
ip_address: ip_address.to_string(),
100101
})
101102
}

0 commit comments

Comments
 (0)