| 50 | private cache: LRUCache<string, CompilationResult>; |
| 51 | |
| 52 | constructor(eventHub: EventEmitter) { |
| 53 | this.allowStoreCodeDebug = true; |
| 54 | this.cache = new LRUCache({ |
| 55 | maxSize: 200 * 1024, |
| 56 | sizeCalculation: n => JSON.stringify(n).length, |
| 57 | }); |
| 58 | |
| 59 | eventHub.on( |
| 60 | 'settingsChange', |
| 61 | (newSettings: SiteSettings) => (this.allowStoreCodeDebug = newSettings.allowStoreCodeDebug), |
| 62 | ); |
| 63 | } |
| 64 | |
| 65 | private async getDefaultCompilerForLang(langId: string): Promise<string> { |
| 66 | const languages = await languagesService.getLanguages(); |