Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D4C83200D52 for ; Sat, 18 Nov 2017 04:45:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id D333F160C0A; Sat, 18 Nov 2017 03:45:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 263B2160BFB for ; Sat, 18 Nov 2017 04:45:00 +0100 (CET) Received: (qmail 99090 invoked by uid 500); 18 Nov 2017 03:45:00 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 99081 invoked by uid 99); 18 Nov 2017 03:45:00 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Nov 2017 03:45:00 +0000 From: GitBox To: commits@cloudstack.apache.org Subject: [GitHub] rhtyd closed pull request #2303: CLOUDSTACK-10123: any entity should use GMT timestamp values Message-ID: <151097669952.14997.10638262494708059998.gitbox@gitbox.apache.org> archived-at: Sat, 18 Nov 2017 03:45:02 -0000 rhtyd closed pull request #2303: CLOUDSTACK-10123: any entity should use GMT timestamp values URL: https://github.com/apache/cloudstack/pull/2303 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index f684cbfe881..ef333563621 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -2608,9 +2608,7 @@ protected void runInContext() { s_logger.trace("VM Operation Thread Running"); try { _workDao.cleanup(VmOpCleanupWait.value()); - - // TODO. hard-coded to one hour after job has been completed - final Date cutDate = new Date(new Date().getTime() - 3600000); + final Date cutDate = new Date(DateUtil.currentGMTTime().getTime() - VmOpCleanupInterval.value() * 1000); _workJobDao.expungeCompletedWorkJobs(cutDate); } catch (final Exception e) { s_logger.error("VM Operations failed due to ", e); @@ -2980,7 +2978,7 @@ protected void runInContext() { try { scanStalledVMInTransitionStateOnDisconnectedHosts(); - final List instances = _vmDao.findVMInTransition(new Date(new Date().getTime() - AgentManager.Wait.value() * 1000), State.Starting, State.Stopping); + final List instances = _vmDao.findVMInTransition(new Date(DateUtil.currentGMTTime().getTime() - AgentManager.Wait.value() * 1000), State.Starting, State.Stopping); for (final VMInstanceVO instance : instances) { final State state = instance.getState(); if (state == State.Stopping) { diff --git a/server/src/com/cloud/test/DatabaseConfig.java b/server/src/com/cloud/test/DatabaseConfig.java index f93692cb725..657eb4e4ce5 100644 --- a/server/src/com/cloud/test/DatabaseConfig.java +++ b/server/src/com/cloud/test/DatabaseConfig.java @@ -43,6 +43,7 @@ import com.cloud.storage.DiskOfferingVO; import com.cloud.storage.Storage.ProvisioningType; import com.cloud.storage.dao.DiskOfferingDaoImpl; +import com.cloud.utils.DateUtil; import com.cloud.utils.PropertiesUtil; import com.cloud.utils.component.ComponentContext; import com.cloud.utils.db.DB; @@ -639,7 +640,7 @@ public void saveStoragePool() { stmt.setLong(8, 0); stmt.setString(9, hostAddress); stmt.setString(10, hostPath); - stmt.setDate(11, new Date(new java.util.Date().getTime())); + stmt.setDate(11, new Date(DateUtil.currentGMTTime().getTime())); stmt.setLong(12, podId); stmt.setString(13, Status.Up.toString()); stmt.setLong(14, clusterId); ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services