Skip to content

Commit 27ae7d8

Browse files
authored
Fixup: register vmscheduler configkey (#8116)
This PR registers the global setting VMScheduledJobExpireInterval.
1 parent ebf1409 commit 27ae7d8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

server/src/main/java/org/apache/cloudstack/vm/schedule/VMSchedulerImpl.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import org.apache.cloudstack.api.command.user.vm.RebootVMCmd;
3535
import org.apache.cloudstack.api.command.user.vm.StartVMCmd;
3636
import org.apache.cloudstack.api.command.user.vm.StopVMCmd;
37+
import org.apache.cloudstack.framework.config.ConfigKey;
38+
import org.apache.cloudstack.framework.config.Configurable;
3739
import org.apache.cloudstack.framework.jobs.AsyncJobDispatcher;
3840
import org.apache.cloudstack.framework.jobs.AsyncJobManager;
3941
import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO;
@@ -58,7 +60,7 @@
5860
import java.util.Timer;
5961
import java.util.TimerTask;
6062

61-
public class VMSchedulerImpl extends ManagerBase implements VMScheduler {
63+
public class VMSchedulerImpl extends ManagerBase implements VMScheduler, Configurable {
6264
private static Logger LOGGER = Logger.getLogger(VMSchedulerImpl.class);
6365
@Inject
6466
private VMScheduledJobDao vmScheduledJobDao;
@@ -82,6 +84,16 @@ public void setAsyncJobDispatcher(final AsyncJobDispatcher dispatcher) {
8284
asyncJobDispatcher = dispatcher;
8385
}
8486

87+
@Override
88+
public ConfigKey<?>[] getConfigKeys() {
89+
return new ConfigKey<?>[]{VMScheduledJobExpireInterval};
90+
}
91+
92+
@Override
93+
public String getConfigComponentName() {
94+
return VMScheduler.class.getSimpleName();
95+
}
96+
8597
@Override
8698
public void removeScheduledJobs(List<Long> vmScheduleIds) {
8799
if (vmScheduleIds == null || vmScheduleIds.isEmpty()) {

0 commit comments

Comments
 (0)