cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [4/5] git commit: updated refs/heads/volume-upload to bc997f1
Date Tue, 17 Feb 2015 06:11:39 GMT
volume upload: using the timeout from configuration

removed the hardcoded 60 min


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

Branch: refs/heads/volume-upload
Commit: 5c4fd12a9b9b2547af76c5ad78350f7c734ecb2b
Parents: 812a140
Author: Rajani Karuturi <rajanikaruturi@gmail.com>
Authored: Mon Feb 2 16:40:55 2015 +0530
Committer: Rajani Karuturi <rajanikaruturi@gmail.com>
Committed: Tue Feb 17 11:33:29 2015 +0530

----------------------------------------------------------------------
 .../src/com/cloud/storage/ImageStoreUploadMonitorImpl.java  | 4 ++++
 server/src/com/cloud/storage/VolumeApiServiceImpl.java      | 9 ++-------
 server/src/com/cloud/template/TemplateManagerImpl.java      | 8 +++-----
 3 files changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5c4fd12a/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java b/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
index cd8985f..6a27f29 100755
--- a/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
+++ b/server/src/com/cloud/storage/ImageStoreUploadMonitorImpl.java
@@ -390,4 +390,8 @@ public class ImageStoreUploadMonitorImpl extends ManagerBase implements
ImageSto
         return new ConfigKey<?>[] {UploadMonitoringInterval, UploadOperationTimeout};
     }
 
+    public static int getUploadOperationTimeout() {
+        return UploadOperationTimeout.value();
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5c4fd12a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 7bc864b..a684d71 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -319,20 +319,15 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
 
         response.setId(UUID.fromString(vol.getUuid()));
 
-        /*
-         * TODO: hardcoding the timeout to current + 60 min for now. This needs to goto the
database
-         */
+        int timeout = ImageStoreUploadMonitorImpl.getUploadOperationTimeout();
         DateTime currentDateTime = new DateTime(DateTimeZone.UTC);
-        currentDateTime.plusHours(1);
-        String expires = currentDateTime.toString();
+        String expires = currentDateTime.plusMinutes(timeout).toString();
         response.setTimeout(expires);
 
         String key = _configDao.getValue(Config.SSVMPSK.key());
          /*
           * encoded metadata using the post upload config key
           */
-
-
         TemplateOrVolumePostUploadCommand command = new TemplateOrVolumePostUploadCommand(vol.getId(),
vol.getUuid(), volumeStore.getInstallPath(), volumeStore.getChecksum(), vol
                 .getType().toString(), vol.getName(), vol.getFormat().toString(), dataObject.getDataStore().getUri(),
dataObject.getDataStore().getRole().toString());
         command.setLocalPath(volumeStore.getLocalDownloadPath());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5c4fd12a/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index d7a298b..7060b09 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -33,6 +33,7 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import com.cloud.storage.ImageStoreUploadMonitorImpl;
 import com.cloud.utils.EncryptionUtil;
 import com.cloud.utils.ImageStoreUtil;
 import com.google.gson.Gson;
@@ -363,12 +364,9 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
 
             response.setId(UUID.fromString(firstCommand.getEntityUUID()));
 
-            /*
-             * TODO: hardcoding the timeout to current + 60 min for now. This needs to goto
the database
-             */
+            int timeout = ImageStoreUploadMonitorImpl.getUploadOperationTimeout();
             DateTime currentDateTime = new DateTime(DateTimeZone.UTC);
-            currentDateTime.plusHours(1);
-            String expires = currentDateTime.toString();
+            String expires = currentDateTime.plusMinutes(timeout).toString();
             response.setTimeout(expires);
 
             String key = _configDao.getValue(Config.SSVMPSK.key());


Mime
View raw message