Merge "[FileBackend] Bumped Swift auth caching TTL."
authorCatrope <roan.kattouw@gmail.com>
Tue, 28 Aug 2012 21:12:46 +0000 (21:12 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 28 Aug 2012 21:12:46 +0000 (21:12 +0000)
1  2 
includes/filebackend/SwiftFileBackend.php

@@@ -111,7 -111,7 +111,7 @@@ class SwiftFileBackend extends FileBack
                        : false;
                $this->swiftCDNExpiry = isset( $config['swiftCDNExpiry'] )
                        ? $config['swiftCDNExpiry']
-                       : 3600; // hour
+                       : 12*3600; // 12 hours is safe (tokens last 24 hours per http://docs.openstack.org)
                $this->swiftCDNPurgable = isset( $config['swiftCDNPurgable'] )
                        ? $config['swiftCDNPurgable']
                        : true;
                                                // See function "create_container_table" in common/db.py.
                                                // If a directory is not "greater" than the last one,
                                                // then it was already listed by the calling iterator.
 -                                              if ( $objectDir > $lastDir ) {
 +                                              if ( strcmp( $objectDir, $lastDir ) > 0 ) {
                                                        $pDir = $objectDir;
                                                        do { // add dir and all its parent dirs
                                                                $dirs[] = "{$pDir}/";
                                                                $pDir = $this->getParentDir( $pDir );
                                                        } while ( $pDir !== false // sanity
 -                                                              && $pDir > $lastDir // not done already
 +                                                              && strcmp( $pDir, $lastDir ) > 0 // not done already
                                                                && strlen( $pDir ) > strlen( $dir ) // within $dir
                                                        );
                                                }