| 12345678910111213141516171819202122232425262728293031 |
- import app from '../../../../app.js'
- import Settings from '@overleaf/settings'
- function startApp() {
- return new Promise((resolve, reject) => {
- app.listen(
- Settings.internal.clsi.port,
- Settings.internal.clsi.host,
- error => {
- if (error) {
- reject(error)
- } else {
- resolve()
- }
- }
- )
- })
- }
- let appStartedPromise
- async function ensureRunning() {
- if (!appStartedPromise) {
- appStartedPromise = startApp()
- }
- await appStartedPromise
- }
- export default {
- ensureRunning,
- }
|