From fc4d26ad3b4396a179011b5d234e3b4ff9783428 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 12 Dec 2013 11:38:01 +0400 Subject: [PATCH] Revert "This patch hangs the server." (the websockets live query code) I accidentally committed this earlier, but it was still a WIP. This reverts commit aef2fba3e11886ab4c02958f33cf80c496b44961. --- server/camlistored/ui/blob_item_container.js | 27 +++----------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/server/camlistored/ui/blob_item_container.js b/server/camlistored/ui/blob_item_container.js index 8798245ae..7193621a7 100644 --- a/server/camlistored/ui/blob_item_container.js +++ b/server/camlistored/ui/blob_item_container.js @@ -307,7 +307,7 @@ camlistore.BlobItemContainer.prototype.search = function(callerConstraint, thumbnailSize: this.thumbnailSize_ }, sort: 1, // LastModifiedDesc - limit: 30, + limit: 50, constraint : { logical: { op: 'and', @@ -323,28 +323,9 @@ camlistore.BlobItemContainer.prototype.search = function(callerConstraint, } }; - var callback = goog.bind(this.searchDone_, this, callerConstraint, - !isContinuation); - if (window.WebSocket) { - var uri = new goog.Uri(goog.uri.utils.appendPath( - this.connection_.config_.searchRoot, 'camli/search/ws')); - uri.setDomain(location.hostname); - uri.setPort(location.port); - uri.setScheme("ws"); - var ws = new WebSocket(uri.toString()); - ws.onopen = function() { - var message = { - tag: 'q1', - query: query - }; - ws.send(JSON.stringify(message)); - }; - ws.onmessage = function(e) { - callback(JSON.parse(e.data).result); - }.bind(this); - } else { - this.connection_.search(JSON.stringify(query), callback); - } + this.connection_.search(JSON.stringify(query), + goog.bind(this.searchDone_, this, callerConstraint, + !isContinuation)); }; camlistore.BlobItemContainer.prototype.searchDone_ = function(constraint,