Author: chabotc
Date: Wed Jun 25 04:35:45 2008
New Revision: 671512

URL: http://svn.apache.org/viewvc?rev=671512&view=rev
Log:
Sometimes if 2 requests were creating the cache dir simultaniously, one of them 
would error out .. so re-check before throwing an error

Modified:
    incubator/shindig/trunk/php/src/common/CacheFile.php

Modified: incubator/shindig/trunk/php/src/common/CacheFile.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/common/CacheFile.php?rev=671512&r1=671511&r2=671512&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/common/CacheFile.php (original)
+++ incubator/shindig/trunk/php/src/common/CacheFile.php Wed Jun 25 04:35:45 
2008
@@ -41,7 +41,10 @@
                $cacheDir = dirname($cacheFile);
                if (! is_dir($cacheDir)) {
                        if (! @mkdir($cacheDir, 0755, true)) {
-                               throw new CacheException("Could not create 
cache directory");
+                               // make sure the failure isn't because of a 
concurency issue
+                               if (! is_dir($cacheDir)) {
+                                       throw new CacheException("Could not 
create cache directory");
+                               }
                        }
                }
                @touch($cacheFile . '.lock');


Reply via email to