batch_processing/core/
job.rs

1use std::time::SystemTime;
2use crate::core::step::StepStatus;
3
4/// Represents the status of a job execution.
5#[derive(Debug, Clone)]
6pub struct JobStatus {
7    /// The name of the job.
8    pub name: String,
9    /// The start time of the job execution.
10    #[allow(dead_code)]
11    pub start_time: Option<u128>,
12    /// The end time of the job execution.
13    #[allow(dead_code)]
14    pub end_time: Option<u128>,
15    /// The status message of the job execution.
16    #[allow(dead_code)]
17    pub status: Result<String, String>,
18    /// The status of each step in the job execution.
19    #[allow(dead_code)]
20    pub steps_status: Vec<StepStatus>,
21}
22
23/// Generates the end time of a job execution.
24pub fn now_time() -> u128 {
25    return SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_millis();
26}