mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 10:12:00 +08:00
17 lines
416 B
JavaScript
17 lines
416 B
JavaScript
|
const SyncWorker = require('./sync-worker');
|
||
|
const DatabaseConnectionFactory = require(`${__base}/core/database-connection-factory`)
|
||
|
|
||
|
class SyncWorkerPool {
|
||
|
constructor() {
|
||
|
this._workers = {};
|
||
|
}
|
||
|
|
||
|
addWorkerForAccount(account) {
|
||
|
DatabaseConnectionFactory.forAccount(account.id).then((db) => {
|
||
|
this._workers[account.id] = new SyncWorker(account, db);
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = SyncWorkerPool;
|