MCPcopy Create free account
hub / github.com/PleasureTools/joyBox / SetupPluginManagerController

Method SetupPluginManagerController

backend/Src/main.ts:312–337  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

310 this.systemResourcesMonitor.Start();
311 }
312 private SetupPluginManagerController() {
313 const settings = this.storage.FetchSettings();
314 if (settings.storageQuota > 0) {
315 const arbiter = new StorageQuota(this.recorder, this.systemResourcesMonitor);
316 arbiter.Quota = settings.storageQuota;
317
318 this.pluginManagerController.AddArbiter(arbiter, STORAGE_QUOTA_ID);
319 }
320
321 if (settings.instanceQuota > 0) {
322 const arbiter = new InstanceQuota(this.pluginManager, this.recorder);
323 arbiter.Quota = settings.instanceQuota;
324
325 this.pluginManagerController.AddArbiter(arbiter, INSTANCE_QUOTA_ID);
326 }
327
328 if (settings.downloadSpeedQuota > 0) {
329 const arbiter = new DownloadSpeedQuota(this.pluginManager, this.recorder);
330 arbiter.Quota = settings.downloadSpeedQuota;
331
332 RpcRequestHandlerImpl.pluginListenerInterceptFn = e => arbiter.StreamFilter(e);
333 this.pluginManagerListener.AddInterceptor(RpcRequestHandlerImpl.pluginListenerInterceptFn);
334
335 this.pluginManagerController.AddArbiter(arbiter, DOWNLOAD_SPEED_QUOTA);
336 }
337 }
338 private async Shutdown() {
339 Logger.Get.Log('Shutting down. Waiting for recorder stops.');
340 const StopRecorder = () => {

Callers 1

StartResourceMonitorMethod · 0.95

Calls 4

StreamFilterMethod · 0.95
FetchSettingsMethod · 0.80
AddArbiterMethod · 0.80
AddInterceptorMethod · 0.80

Tested by

no test coverage detected