airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/2] airavata-php-gateway git commit: invalidating cached app interface and CR values when updating/deleting
Date Tue, 30 Jun 2015 15:51:38 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/airavata-php-gateway-0.15-release 07664c6c5 -> a411b2b20


invalidating cached app interface and CR values when updating/deleting


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

Branch: refs/heads/airavata-php-gateway-0.15-release
Commit: 76e9c65c9025c990ac2ed6e15e0b21b97b450ddd
Parents: 07664c6
Author: Supun Nakandala <scnakandala@apache.org>
Authored: Tue Jun 30 15:49:03 2015 +0530
Committer: Supun Nakandala <scnakandala@apache.org>
Committed: Tue Jun 30 15:49:27 2015 +0530

----------------------------------------------------------------------
 app/libraries/CRUtilities.php | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/76e9c65c/app/libraries/CRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php
index 6e37cc6..16df103 100755
--- a/app/libraries/CRUtilities.php
+++ b/app/libraries/CRUtilities.php
@@ -106,6 +106,11 @@ class CRUtilities
 
     public static function deleteQueue($computeResourceId, $queueName)
     {
+        if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+            if (Cache::has('CR-' . $computeResourceId)) {
+                Cache::forget('CR-' . $computeResourceId);
+            }
+        }
         Airavata::deleteBatchQueue($computeResourceId, $queueName);
     }
 
@@ -119,6 +124,11 @@ class CRUtilities
 
         $computeResource = CRUtilities::get_compute_resource($inputs["crId"]);
 
+        if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+            if (Cache::has('CR-' . $inputs["crId"])) {
+                Cache::forget('CR-' . $inputs["crId"]);
+            }
+        }
 
         $jsiId = null;
         if (isset($inputs["jsiId"]))
@@ -220,6 +230,13 @@ class CRUtilities
     {
 
         $computeResource = CRUtilities::get_compute_resource($inputs["crId"]);
+
+        if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+            if (Cache::has('CR-' . $inputs["crId"])) {
+                Cache::forget('CR-' . $inputs["crId"]);
+            }
+        }
+
         if ($inputs["dataMovementProtocol"] == DataMovementProtocol::LOCAL) /* LOCAL */ {
             $localDataMovement = new LOCALDataMovement();
             $localdmp = Airavata::addLocalDataMovementDetails($computeResource->computeResourceId,
0, $localDataMovement);
@@ -326,6 +343,20 @@ class CRUtilities
 
     public static function deleteActions($inputs)
     {
+        if (isset($inputs["crId"])) {
+            if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+                if (Cache::has('CR-' . $inputs["crId"])) {
+                    Cache::forget('CR-' . $inputs["crId"]);
+                }
+            }
+        } elseif (isset($inputs["del-crId"])) {
+            if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+                if (Cache::has('CR-' . $inputs["del-crId"])) {
+                    Cache::forget('CR-' . $inputs["del-crId"]);
+                }
+            }
+        }
+
         if (isset($inputs["jsiId"]))
             if (Airavata::deleteJobSubmissionInterface($inputs["crId"], $inputs["jsiId"]))
                 return 1;
@@ -400,6 +431,12 @@ class CRUtilities
     {
         $computeResourcePreferences = new computeResourcePreference($inputs);
 
+        if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
+            if (Cache::has('CR-' . $inputs["computeResourceId"])) {
+                Cache::forget('CR-' . $inputs["computeResourceId"]);
+            }
+        }
+
         //var_dump( $inputs); exit;
         return Airavata::addGatewayComputeResourcePreference($inputs["gatewayId"], $inputs["computeResourceId"],
$computeResourcePreferences);
 
@@ -418,6 +455,7 @@ class CRUtilities
                 Cache::forget('CR-' . $id);
             }
         }
+
         return Airavata::deleteGatewayComputeResourcePreference($inputs["gpId"], $inputs["rem-crId"]);
     }
 


Mime
View raw message