});
BootstrapFrontend.setup({
+ backgroundQueueUrl: '{link controller="BackgroundQueuePerform"}{/link}',
styleChanger: {if $__wcf->getStyleHandler()->countStyles() > 1}true{else}false{/if}
});
});
});
{/if}
- {* invoke background queue roughly every 10th request *}
- if (Math.random() < 0.1) {
- require(['Ajax'], function(Ajax) {
- // fire and forget background queue perform task
- Ajax.apiOnce({
- url: '{link controller="BackgroundQueuePerform"}{/link}',
- ignoreError: true,
- silent: true
- });
- });
- }
-
{if $__sessionKeepAlive|isset}
new WCF.System.KeepAlive({@$__sessionKeepAlive});
{/if}
}
this._initUserPopover();
+ this._invokeBackgroundQueue(options.backgroundQueueUrl);
},
/**
}, callback, callback);
}
});
+ },
+
+ /**
+ * Invokes the background queue roughly every 10th request.
+ *
+ * @param {string} url background queue url
+ */
+ _invokeBackgroundQueue: function(url) {
+ if (Math.random() < 0.1) {
+ // 'fire and forget' background queue perform task
+ Ajax.apiOnce({
+ url: url,
+ ignoreError: true,
+ silent: true
+ });
+ }
}
};