jenkins-bot has submitted this change and it was merged.

Change subject: Make Raven initialization caching more efficient
......................................................................


Make Raven initialization caching more efficient

Depends on core patch I5528f5f91a7452ff05b7493466467cf026f59c40.

Change-Id: I14c25e1de49dceb75e50a50adc2077522e82733d
---
M resources/init.js
1 file changed, 7 insertions(+), 7 deletions(-)

Approvals:
  Gilles: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/init.js b/resources/init.js
index 6b8e22b..5a2691f 100644
--- a/resources/init.js
+++ b/resources/init.js
@@ -1,12 +1,12 @@
 ( function ( mw, $ ) {
-       var raven;
+       var ravenPromise;
 
        /**
         * @return {jQuery.Deferred} a deferred with the Raven.js object
         */
        function initRaven() {
-               return mw.loader.using( 'sentry.raven' ).then( function () {
-                       if ( !raven ) {
+               if ( !ravenPromise ) {
+                       ravenPromise = mw.loader.using( 'sentry.raven' ).then( 
function () {
                                var config = mw.config.get( 'wgSentry' ),
                                        options = {};
 
@@ -34,10 +34,10 @@
 
                                Raven.config( config.dsn, options ).install();
 
-                               raven = Raven;
-                       }
-                       return raven;
-               } );
+                               return Raven;
+                       } );
+               }
+               return ravenPromise;
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/200291
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I14c25e1de49dceb75e50a50adc2077522e82733d
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Sentry
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <gti...@wikimedia.org>
Gerrit-Reviewer: Gergő Tisza <gti...@wikimedia.org>
Gerrit-Reviewer: Gilles <gdu...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to