mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-05 13:10:27 +00:00
api: backup: code reduction
had it lying around and did not felt condensed/code-golfed to me, rather a bit more expressive (surely biased though).. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
0652096e2f
commit
5cc0c3a008
@ -52,15 +52,12 @@ my $convert_to_schedule = sub {
|
||||
|
||||
my $starttime = $job->{starttime};
|
||||
|
||||
my $dow = $job->{dow};
|
||||
return "$starttime" if !$job->{dow}; # dow is restrictive, so none means all days
|
||||
|
||||
# normalize as it could be a null-separated list previously
|
||||
$dow = join(',', PVE::Tools::split_list($dow)) if defined($dow);
|
||||
my $dow = join(',', PVE::Tools::split_list($job->{dow}));
|
||||
|
||||
if (!$dow || $dow eq ALL_DAYS) {
|
||||
return "$starttime";
|
||||
}
|
||||
|
||||
return "$dow $starttime";
|
||||
return $dow eq ALL_DAYS ? "$starttime" : "$dow $starttime";
|
||||
};
|
||||
|
||||
my $schedule_param_check = sub {
|
||||
|
Loading…
Reference in New Issue
Block a user