This is an automated email from the ASF dual-hosted git repository.

shwstppr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 27ae7d8bc48 Fixup: register vmscheduler configkey (#8116)
27ae7d8bc48 is described below

commit 27ae7d8bc48170bdeacb5021e2058ea3ed0b1b94
Author: Vishesh <[email protected]>
AuthorDate: Thu Oct 26 00:57:10 2023 +0530

    Fixup: register vmscheduler configkey (#8116)
    
    This PR registers the global setting VMScheduledJobExpireInterval.
---
 .../org/apache/cloudstack/vm/schedule/VMSchedulerImpl.java | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git 
a/server/src/main/java/org/apache/cloudstack/vm/schedule/VMSchedulerImpl.java 
b/server/src/main/java/org/apache/cloudstack/vm/schedule/VMSchedulerImpl.java
index 34548fc9258..5d25f36ca31 100644
--- 
a/server/src/main/java/org/apache/cloudstack/vm/schedule/VMSchedulerImpl.java
+++ 
b/server/src/main/java/org/apache/cloudstack/vm/schedule/VMSchedulerImpl.java
@@ -34,6 +34,8 @@ import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.command.user.vm.RebootVMCmd;
 import org.apache.cloudstack.api.command.user.vm.StartVMCmd;
 import org.apache.cloudstack.api.command.user.vm.StopVMCmd;
+import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.jobs.AsyncJobDispatcher;
 import org.apache.cloudstack.framework.jobs.AsyncJobManager;
 import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO;
@@ -58,7 +60,7 @@ import java.util.Map;
 import java.util.Timer;
 import java.util.TimerTask;
 
-public class VMSchedulerImpl extends ManagerBase implements VMScheduler {
+public class VMSchedulerImpl extends ManagerBase implements VMScheduler, 
Configurable {
     private static Logger LOGGER = Logger.getLogger(VMSchedulerImpl.class);
     @Inject
     private VMScheduledJobDao vmScheduledJobDao;
@@ -82,6 +84,16 @@ public class VMSchedulerImpl extends ManagerBase implements 
VMScheduler {
         asyncJobDispatcher = dispatcher;
     }
 
+    @Override
+    public ConfigKey<?>[] getConfigKeys() {
+        return new ConfigKey<?>[]{VMScheduledJobExpireInterval};
+    }
+
+    @Override
+    public String getConfigComponentName() {
+        return VMScheduler.class.getSimpleName();
+    }
+
     @Override
     public void removeScheduledJobs(List<Long> vmScheduleIds) {
         if (vmScheduleIds == null || vmScheduleIds.isEmpty()) {

Reply via email to