Skip to content

Commit f1e91c4

Browse files
committed
Update 11573
1 parent 7ecfb41 commit f1e91c4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import com.cloud.utils.DateUtil;
2828
import com.cloud.utils.component.ComponentContext;
2929
import com.cloud.utils.component.ManagerBase;
30-
import com.cloud.utils.db.Filter;
3130
import com.cloud.utils.db.GlobalLock;
3231
import com.cloud.vm.UserVmManager;
3332
import com.cloud.vm.VirtualMachine;
@@ -197,7 +196,7 @@ public boolean start() {
197196
final TimerTask schedulerPollTask = new ManagedContextTimerTask() {
198197
@Override
199198
protected void runInContext() {
200-
ManagementServerHostVO msHost = managementServerHostDao.findOneInUpState(new Filter(ManagementServerHostVO.class, "id", false, 0L, 1L));
199+
ManagementServerHostVO msHost = managementServerHostDao.findOneByLongestRuntime();
201200
if (msHost == null || (msHost.getMsid() != ManagementServerNode.getManagementServerId())) {
202201
logger.debug("Skipping the vm scheduler poll task on this management server");
203202
return;

0 commit comments

Comments
 (0)