mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
20 lines
601 B
JavaScript
20 lines
601 B
JavaScript
|
const path = require('path');
|
||
|
|
||
|
global.__base = path.join(__dirname, '..')
|
||
|
global.config = require(`${__base}/core/config/${process.env.ENV || 'development'}.json`);
|
||
|
|
||
|
const DatabaseConnectionFactory = require(`${__base}/core/database-connection-factory`)
|
||
|
const SyncWorkerPool = require('./sync-worker-pool');
|
||
|
const workerPool = new SyncWorkerPool();
|
||
|
|
||
|
DatabaseConnectionFactory.forShared().then((db) => {
|
||
|
const {Account} = db
|
||
|
Account.findAll().then((accounts) => {
|
||
|
accounts.forEach((account) => {
|
||
|
workerPool.addWorkerForAccount(account);
|
||
|
});
|
||
|
});
|
||
|
});
|
||
|
|
||
|
global.workerPool = workerPool;
|