mirror of
https://git.proxmox.com/git/proxmox
synced 2025-04-29 07:54:43 +00:00
api: admin/config: introduce sync direction as job config parameter
Add the sync direction for the sync job as optional config parameter and refrain from using the config section type for conditional direction check, as they are now the same (see previous commit). Use the configured sync job parameter instead of passing it to the various methods as function parameter and only filter based on sync direction if an optional api parameter to distingush/filter based on direction is given. Signed-off-by: Christian Ebner <c.ebner@proxmox.com> Reviewed-by: Dominik Csapak <d.csapak@proxmox.com> Tested-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
efc45db20c
commit
d70f6d9f09
@ -597,7 +597,11 @@ pub const RESYNC_CORRUPT_SCHEMA: Schema =
|
||||
"resync-corrupt": {
|
||||
schema: RESYNC_CORRUPT_SCHEMA,
|
||||
optional: true,
|
||||
}
|
||||
},
|
||||
"sync-direction": {
|
||||
type: SyncDirection,
|
||||
optional: true,
|
||||
},
|
||||
}
|
||||
)]
|
||||
#[derive(Serialize, Deserialize, Clone, Updater, PartialEq)]
|
||||
@ -633,6 +637,8 @@ pub struct SyncJobConfig {
|
||||
pub transfer_last: Option<usize>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub resync_corrupt: Option<bool>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub sync_direction: Option<SyncDirection>,
|
||||
}
|
||||
|
||||
impl SyncJobConfig {
|
||||
|
Loading…
Reference in New Issue
Block a user