airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: status update time issues
Date Fri, 18 Dec 2015 19:02:34 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 9ba3f0301 -> b161ec4ee


status update time issues


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b161ec4e
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b161ec4e
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b161ec4e

Branch: refs/heads/master
Commit: b161ec4ee5ae44460c4e72b9c038f728f72ceeac
Parents: 9ba3f03
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Fri Dec 18 14:02:27 2015 -0500
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Fri Dec 18 14:02:27 2015 -0500

----------------------------------------------------------------------
 .../core/experiment/catalog/resources/JobStatusResource.java    | 5 +++++
 .../experiment/catalog/resources/ProcessStatusResource.java     | 5 +++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/b161ec4e/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobStatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobStatusResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobStatusResource.java
index c8e76ec..1664cf4 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobStatusResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/JobStatusResource.java
@@ -21,6 +21,7 @@
 
 package org.apache.airavata.registry.core.experiment.catalog.resources;
 
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
 import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
 import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
@@ -147,6 +148,10 @@ public class JobStatusResource extends AbstractExpCatResource {
             jobStatus.setTaskId(taskId);
             jobStatus.setState(state);
             jobStatus.setReason(reason);
+            if (timeOfStateChange == null){
+                timeOfStateChange = AiravataUtils.getCurrentTimestamp();
+            }
+            jobStatus.setTimeOfStateChange(timeOfStateChange);
             if (existingJobStatus == null){
                 em.persist(jobStatus);
             }else {

http://git-wip-us.apache.org/repos/asf/airavata/blob/b161ec4e/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
index 8123f29..2e4ba91 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
@@ -21,6 +21,7 @@
 
 package org.apache.airavata.registry.core.experiment.catalog.resources;
 
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
 import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
 import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
@@ -136,6 +137,10 @@ public class ProcessStatusResource extends AbstractExpCatResource {
             processStatus.setProcessId(processId);
             processStatus.setState(state);
             processStatus.setReason(reason);
+            if (timeOfStateChange == null){
+                timeOfStateChange = AiravataUtils.getCurrentTimestamp();
+            }
+            processStatus.setTimeOfStateChange(timeOfStateChange);
             if (existingStatus == null){
                 em.persist(processStatus);
             }else {


Mime
View raw message