* [pve-devel] [PATCH manager] schedule-analyze: fix schedules with limited runs
@ 2022-05-03 14:10 Dominik Csapak
2022-05-04 5:15 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2022-05-03 14:10 UTC (permalink / raw)
To: pve-devel
When a schedule only has a limited amount of runs it can happen
(e.g. 2022-10-01 8:00/30), $next will be undef after the last run.
Exit early in that case.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
PVE/API2/Cluster/Jobs.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/PVE/API2/Cluster/Jobs.pm b/PVE/API2/Cluster/Jobs.pm
index 2699442a..8166333d 100644
--- a/PVE/API2/Cluster/Jobs.pm
+++ b/PVE/API2/Cluster/Jobs.pm
@@ -97,6 +97,7 @@ __PACKAGE__->register_method({
for (my $count = 0; $count < $iterations; $count++) {
my $next = PVE::CalendarEvent::compute_next_event($event, $starttime);
+ last if !defined($next);
push @$result, {
timestamp => $next,
utc => scalar(gmtime($next)),
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-04 5:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 14:10 [pve-devel] [PATCH manager] schedule-analyze: fix schedules with limited runs Dominik Csapak
2022-05-04 5:15 ` [pve-devel] applied: " Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal