()
| 66 | } |
| 67 | |
| 68 | async prepareData() { |
| 69 | // Init database |
| 70 | const appDataSource = getDataSource() |
| 71 | await appDataSource.initialize() |
| 72 | await appDataSource.runMigrations({ transaction: 'each' }) |
| 73 | |
| 74 | // Initialize abortcontroller pool |
| 75 | const abortControllerPool = new AbortControllerPool() |
| 76 | |
| 77 | // Init telemetry |
| 78 | const telemetry = new Telemetry() |
| 79 | |
| 80 | // Initialize nodes pool |
| 81 | const nodesPool = new NodesPool() |
| 82 | await nodesPool.initialize() |
| 83 | |
| 84 | // Initialize cache pool |
| 85 | const cachePool = new CachePool() |
| 86 | |
| 87 | // Initialize usage cache manager |
| 88 | const usageCacheManager = await UsageCacheManager.getInstance() |
| 89 | |
| 90 | // Initialize identity manager |
| 91 | const identityManager = await IdentityManager.getInstance() |
| 92 | |
| 93 | return { |
| 94 | appDataSource, |
| 95 | telemetry, |
| 96 | componentNodes: nodesPool.componentNodes, |
| 97 | cachePool, |
| 98 | abortControllerPool, |
| 99 | usageCacheManager, |
| 100 | identityManager |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | async catch(error: Error) { |
| 105 | if (error.stack) logger.error(error.stack) |
no test coverage detected