DaanHoogland commented on a change in pull request #4641:
URL: https://github.com/apache/cloudstack/pull/4641#discussion_r568637859



##########
File path: server/src/main/java/com/cloud/storage/download/DownloadListener.java
##########
@@ -284,18 +308,22 @@ public void processConnect(Host agent, StartupCommand 
cmd, boolean forRebalance)
             _imageSrv.handleSysTemplateDownload(hostHyper, 
agent.getDataCenterId());
             // update template_zone_ref for cross-zone templates
             
_imageSrv.associateCrosszoneTemplatesToZone(agent.getDataCenterId());
+        } else if (cmd instanceof StartupSecondaryStorageCommand) {
+            s_logger.debug("Scheduling postConnect task at " + 
STATUS_POLL_INTERVAL + " ms");
+            schedulePostConnectTask(agent, cmd, STATUS_POLL_INTERVAL);
         }
-        /* This can be removed
-        else if ( cmd instanceof StartupStorageCommand) {
-            StartupStorageCommand storage = (StartupStorageCommand)cmd;
-            if( storage.getResourceType() == 
Storage.StorageResourceType.SECONDARY_STORAGE ||
-                    storage.getResourceType() == 
Storage.StorageResourceType.LOCAL_SECONDARY_STORAGE  ) {
-                downloadMonitor.addSystemVMTemplatesToHost(agent, 
storage.getTemplateInfo());
-                downloadMonitor.handleTemplateSync(agent);
-                downloadMonitor.handleVolumeSync(agent);
-            }
-        }*/
-        else if (cmd instanceof StartupSecondaryStorageCommand) {
+    }
+
+    private void schedulePostConnectTask(Host agent, StartupCommand cmd, long 
delay) {
+        if (_postConnectTask != null)
+            _postConnectTask.cancel();

Review comment:
       is this only ever working on one dowload job? it seems we are canceling 
the download check for someone else here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to