mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-06 03:14:39 +08:00
🎨 remove outdated comments
This commit is contained in:
parent
9abcf7e8d8
commit
6aa5ad509a
1 changed files with 0 additions and 22 deletions
|
@ -5,28 +5,6 @@ const {Actions} = require('nylas-exports')
|
||||||
const SyncWorker = require('./sync-worker');
|
const SyncWorker = require('./sync-worker');
|
||||||
const LocalDatabaseConnector = require('../shared/local-database-connector')
|
const LocalDatabaseConnector = require('../shared/local-database-connector')
|
||||||
|
|
||||||
/*
|
|
||||||
Accounts ALWAYS exist in either `accounts:unclaimed` or an `accounts:{id}` list.
|
|
||||||
They are atomically moved between these sets as they are claimed and returned.
|
|
||||||
|
|
||||||
Periodically, each worker in the pool looks at all the `accounts:{id}` lists.
|
|
||||||
For each list it finds, it checks for the existence of `heartbeat:{id}`, a key
|
|
||||||
that expires quickly if the sync process doesn't refresh it.
|
|
||||||
|
|
||||||
If it does not find the key, it moves all of the accounts in the list back to
|
|
||||||
the unclaimed key.
|
|
||||||
|
|
||||||
Sync processes only claim an account for a fixed period of time. This means that
|
|
||||||
an engineer can add new sync machines to the pool and the load across instances
|
|
||||||
will balance on it's own. It also means one bad instance will not permanently
|
|
||||||
disrupt sync for any accounts. (Eg: instance has faulty network connection.)
|
|
||||||
|
|
||||||
Sync processes periodically claim accounts when they can find them, regardless
|
|
||||||
of how busy they are. A separate API (`/routes/monitoring`) allows CloudWatch
|
|
||||||
to decide whether to spin up instances or take them offline based on CPU/RAM
|
|
||||||
utilization across the pool.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class SyncProcessManager {
|
class SyncProcessManager {
|
||||||
constructor() {
|
constructor() {
|
||||||
this._workers = {};
|
this._workers = {};
|
||||||
|
|
Loading…
Add table
Reference in a new issue