Always reinstall cron when saving a schedule
Previously the cron was only updated if it was already active. Now every save reinstalls the cron entry so changes (like enabling --sysbackup) take effect immediately. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -252,11 +252,8 @@ sub handle_edit {
|
|||||||
if (!@errors) {
|
if (!@errors) {
|
||||||
my ($ok, $err) = GnizaWHM::Config::write($conf_path, \%data, \@GnizaWHM::Config::SCHEDULE_KEYS);
|
my ($ok, $err) = GnizaWHM::Config::write($conf_path, \%data, \@GnizaWHM::Config::SCHEDULE_KEYS);
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
# Re-install cron if it was active, so timing/remote changes take effect
|
# Always reinstall cron so changes take effect immediately
|
||||||
my $cron_schedules = GnizaWHM::Cron::get_current_schedules();
|
GnizaWHM::Cron::install_schedule($name);
|
||||||
if (exists $cron_schedules->{$name}) {
|
|
||||||
GnizaWHM::Cron::install_schedule($name);
|
|
||||||
}
|
|
||||||
GnizaWHM::UI::set_flash('success', "Schedule '$name' updated successfully.");
|
GnizaWHM::UI::set_flash('success', "Schedule '$name' updated successfully.");
|
||||||
print "Status: 302 Found\r\n";
|
print "Status: 302 Found\r\n";
|
||||||
print "Location: schedules.cgi\r\n\r\n";
|
print "Location: schedules.cgi\r\n\r\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user