[local-sync] Remove unused message-types

This commit is contained in:
Juan Tejada 2016-11-23 13:30:51 -08:00
parent 43030789a8
commit f45425a7b6
2 changed files with 0 additions and 30 deletions

View file

@ -4,7 +4,6 @@ const {
PromiseUtils, PromiseUtils,
} = require('isomorphic-core'); } = require('isomorphic-core');
const LocalDatabaseConnector = require('../shared/local-database-connector') const LocalDatabaseConnector = require('../shared/local-database-connector')
const MessageTypes = require('../shared/message-types')
const { const {
jsonError, jsonError,
} = require('./sync-utils') } = require('./sync-utils')
@ -28,8 +27,6 @@ class SyncWorker {
this._destroyed = false; this._destroyed = false;
this.syncNow({reason: 'Initial'}); this.syncNow({reason: 'Initial'});
this._onMessage = this._onMessage.bind(this);
} }
cleanup() { cleanup() {
@ -45,27 +42,6 @@ class SyncWorker {
} }
} }
_onMessage(msg) {
const {type} = JSON.parse(msg);
switch (type) {
case MessageTypes.ACCOUNT_CREATED:
// No other processing currently required for account creation
break;
case MessageTypes.ACCOUNT_UPDATED:
this._onAccountUpdated();
break;
case MessageTypes.ACCOUNT_DELETED:
this.cleanup();
this._onExpired();
break;
case MessageTypes.SYNCBACK_REQUESTED:
this.syncNow({reason: 'Syncback Action Queued'});
break;
default:
this._logger.error({message: msg}, 'SyncWorker: Invalid message')
}
}
_onAccountUpdated() { _onAccountUpdated() {
const syncingNow = !this.isWaitingForNextSync() const syncingNow = !this.isWaitingForNextSync()
const syncingJustFinished = (Date.now() - this._lastSyncTime < 5000); const syncingJustFinished = (Date.now() - this._lastSyncTime < 5000);

View file

@ -1,6 +0,0 @@
module.exports = {
ACCOUNT_CREATED: "ACCOUNT_CREATED",
ACCOUNT_UPDATED: "ACCOUNT_UPDATED",
ACCOUNT_DELETED: "ACCOUNT_DELETED",
SYNCBACK_REQUESTED: "SYNCBACK_REQUESTED",
}