зеркало из https://github.com/mozilla/gecko-dev.git
bug 518273 - need to handle not having an active node assigned, r=edilee
--HG-- extra : rebase_source : f86c6cc164241cee263345de5e13dd5ae0a3758b
This commit is contained in:
Родитель
1468737a00
Коммит
061821547d
|
@ -21,5 +21,7 @@ error.logout.title = Error While Signing Out
|
||||||
error.logout.description = Weave encountered an error while signing you out. It's probably ok, and you don't have to do anything about it.
|
error.logout.description = Weave encountered an error while signing you out. It's probably ok, and you don't have to do anything about it.
|
||||||
error.sync.title = Error While Syncing
|
error.sync.title = Error While Syncing
|
||||||
error.sync.description = Weave encountered an error while syncing: %1$S. Weave will automatically retry this action.
|
error.sync.description = Weave encountered an error while syncing: %1$S. Weave will automatically retry this action.
|
||||||
|
error.sync.no_node_found = The Weave server is a little busy right now, but you don't need to do anything about it. We'll start syncing your data as soon as we can!
|
||||||
|
error.sync.no_node_found.title = Sync Delay
|
||||||
error.sync.tryAgainButton.label = Sync Now
|
error.sync.tryAgainButton.label = Sync Now
|
||||||
error.sync.tryAgainButton.accesskey = S
|
error.sync.tryAgainButton.accesskey = S
|
||||||
|
|
|
@ -101,6 +101,7 @@ NO_KEYS_NO_KEYGEN: "error.sync.reason.no_keys_no_keygen",
|
||||||
KEYS_UPLOAD_FAIL: "error.sync.reason.keys_upload_fail",
|
KEYS_UPLOAD_FAIL: "error.sync.reason.keys_upload_fail",
|
||||||
SETUP_FAILED_NO_PASSPHRASE: "error.sync.reason.setup_failed_no_passphrase",
|
SETUP_FAILED_NO_PASSPHRASE: "error.sync.reason.setup_failed_no_passphrase",
|
||||||
ABORT_SYNC_COMMAND: "aborting sync, process commands said so",
|
ABORT_SYNC_COMMAND: "aborting sync, process commands said so",
|
||||||
|
NO_SYNC_NODE_FOUND: "error.sync.reason.no_node_found",
|
||||||
|
|
||||||
// engine failure status codes
|
// engine failure status codes
|
||||||
ENGINE_UPLOAD_FAIL: "error.engine.reason.record_upload_fail",
|
ENGINE_UPLOAD_FAIL: "error.engine.reason.record_upload_fail",
|
||||||
|
|
|
@ -489,6 +489,8 @@ WeaveSvc.prototype = {
|
||||||
return this.serverURL;
|
return this.serverURL;
|
||||||
case 0:
|
case 0:
|
||||||
case 200:
|
case 200:
|
||||||
|
if (node == "null")
|
||||||
|
node = null;
|
||||||
return node;
|
return node;
|
||||||
default:
|
default:
|
||||||
this._log.debug("Unexpected response code: " + node.status);
|
this._log.debug("Unexpected response code: " + node.status);
|
||||||
|
@ -505,6 +507,7 @@ WeaveSvc.prototype = {
|
||||||
_setCluster: function _setCluster() {
|
_setCluster: function _setCluster() {
|
||||||
// Make sure we didn't get some unexpected response for the cluster
|
// Make sure we didn't get some unexpected response for the cluster
|
||||||
let cluster = this._findCluster();
|
let cluster = this._findCluster();
|
||||||
|
this._log.debug("cluster value = " + cluster);
|
||||||
if (cluster == null)
|
if (cluster == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -532,8 +535,13 @@ WeaveSvc.prototype = {
|
||||||
_verifyLogin: function _verifyLogin()
|
_verifyLogin: function _verifyLogin()
|
||||||
this._notify("verify-login", "", function() {
|
this._notify("verify-login", "", function() {
|
||||||
// Make sure we have a cluster to verify against
|
// Make sure we have a cluster to verify against
|
||||||
if (this.clusterURL == "")
|
// this is a little weird, if we don't get a node we pretend
|
||||||
this._setCluster();
|
// to succeed, since that probably means we just don't have storage
|
||||||
|
if (this.clusterURL == "" && !this._setCluster()) {
|
||||||
|
this.status.setSyncStatus(NO_SYNC_NODE_FOUND);
|
||||||
|
Svc.Observer.notifyObservers(null, "weave:service:sync:delayed", "");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let test = new Resource(this.infoURL).get();
|
let test = new Resource(this.infoURL).get();
|
||||||
|
@ -1074,6 +1082,14 @@ WeaveSvc.prototype = {
|
||||||
sync: function sync()
|
sync: function sync()
|
||||||
this._catch(this._lock(this._notify("sync", "", function() {
|
this._catch(this._lock(this._notify("sync", "", function() {
|
||||||
this.status.resetEngineStatus();
|
this.status.resetEngineStatus();
|
||||||
|
|
||||||
|
// if we don't have a node, get one. if that fails, retry in 10 minutes
|
||||||
|
if (this.clusterURL == "" && !this._setCluster()) {
|
||||||
|
this._scheduleNextSync(10 * 60 * 1000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fullSync = true; // not doing thresholds yet
|
||||||
|
|
||||||
// Make sure we should sync or record why we shouldn't
|
// Make sure we should sync or record why we shouldn't
|
||||||
let reason = this._checkSync();
|
let reason = this._checkSync();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче