Merge "[FileBackend] Made Swift clear the auth cache on certain HTTP errors."
authorCatrope <roan.kattouw@gmail.com>
Tue, 28 Aug 2012 21:13:05 +0000 (21:13 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 28 Aug 2012 21:13:05 +0000 (21:13 +0000)
includes/filebackend/SwiftFileBackend.php

index 960d71c..9c111c9 100644 (file)
@@ -1297,6 +1297,9 @@ class SwiftFileBackend extends FileBackendStore {
                if ( $e->getMessage() ) {
                        trigger_error( "$func: " . $e->getMessage(), E_USER_WARNING );
                }
+               if ( $e instanceof InvalidResponseException ) { // possibly a stale token
+                       $this->srvCache->delete( $this->getCredsCacheKey( $this->auth->username ) );
+               }
                wfDebugLog( 'SwiftBackend',
                        get_class( $e ) . " in '{$func}' (given '" . FormatJson::encode( $params ) . "')" .
                        ( $e->getMessage() ? ": {$e->getMessage()}" : "" )