Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BF5EB188AC for ; Tue, 14 Jul 2015 16:38:41 +0000 (UTC) Received: (qmail 94083 invoked by uid 500); 14 Jul 2015 16:38:07 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 93788 invoked by uid 500); 14 Jul 2015 16:38:07 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 93189 invoked by uid 99); 14 Jul 2015 16:38:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2015 16:38:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C3F0AE03C8; Tue, 14 Jul 2015 16:38:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smarru@apache.org To: commits@airavata.apache.org Date: Tue, 14 Jul 2015 16:38:30 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [25/40] airavata-php-gateway git commit: invalidating cached app interface and CR values when updating/deleting 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/07664c6c Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/07664c6c Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/07664c6c Branch: refs/heads/0.15-release-branch Commit: 07664c6c555ef9796538d55162cbc7e9bcdf8878 Parents: 476a075 Author: Supun Nakandala Authored: Tue Jun 30 14:51:53 2015 +0530 Committer: Supun Nakandala Committed: Tue Jun 30 14:52:22 2015 +0530 ---------------------------------------------------------------------- app/libraries/AppUtilities.php | 16 +++++++++++++--- app/libraries/CRUtilities.php | 11 +++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/07664c6c/app/libraries/AppUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/AppUtilities.php b/app/libraries/AppUtilities.php index cc7323f..7134360 100644 --- a/app/libraries/AppUtilities.php +++ b/app/libraries/AppUtilities.php @@ -100,16 +100,26 @@ class AppUtilities //var_dump( $appInterface); exit; - if ($update) + if ($update) { + if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) { + if (Cache::has('APP-' . $appInterfaceValues["app-interface-id"])) { + Cache::forget('APP-' . $appInterfaceValues["app-interface-id"]); + } + } Airavata::updateApplicationInterface($appInterfaceValues["app-interface-id"], $appInterface); - else + } else { Airavata::getApplicationInterface(Airavata::registerApplicationInterface(Session::get("gateway_id"), $appInterface)); - + } //print_r( "App interface has been created."); } public static function deleteAppInterface($appInterfaceId) { + if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) { + if (Cache::has('APP-' . $appInterfaceId)) { + Cache::forget('APP-' . $appInterfaceId); + } + } return Airavata::deleteApplicationInterface($appInterfaceId); } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/07664c6c/app/libraries/CRUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php index 850c2c8..6e37cc6 100755 --- a/app/libraries/CRUtilities.php +++ b/app/libraries/CRUtilities.php @@ -41,6 +41,11 @@ class CRUtilities { if ($update) { $computeResourceId = $computeDescription->computeResourceId; + if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) { + if (Cache::has('CR-' . $computeResourceId)) { + Cache::forget('CR-' . $computeResourceId); + } + } if (Airavata::updateComputeResource($computeResourceId, $computeDescription)) { $computeResource = Airavata::getComputeResource($computeResourceId); @@ -407,6 +412,12 @@ class CRUtilities public static function deleteCR($inputs) { + if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) { + $id = $inputs["rem-crId"]; + if (Cache::has('CR-' . $id)) { + Cache::forget('CR-' . $id); + } + } return Airavata::deleteGatewayComputeResourcePreference($inputs["gpId"], $inputs["rem-crId"]); }