Skip to content

Commit

Permalink
resolves reset issue on delta
Browse files Browse the repository at this point in the history
  • Loading branch information
sintaxi committed Feb 28, 2013
1 parent b842589 commit b8fbed8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/dbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ exports.app = function(config){

var entries = []
var REQUEST_CONCURRENCY_DELAY = 20
var reset;

var fetch = function(args){
var signature = helpers.sign(options, args)
Expand All @@ -87,6 +88,10 @@ exports.app = function(config){
return request(opts, function(e, r, b){
var status = e ? null : r.statusCode
var output = helpers.parseJSON(b)

if(typeof reset == 'undefined'){
reset = output.reset
}

if(output && output.hasOwnProperty("entries")){
output["entries"].forEach(function(entry){
Expand All @@ -99,6 +104,7 @@ exports.app = function(config){
}else{
if(output){
output["entries"] = entries
output["reset"] = reset
}
// console.log("MADE IT:", status, output)
cb(status, output)
Expand Down
1 change: 1 addition & 0 deletions test/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ describe("all", function(){
it("should get delta results", function(done) {
client.delta(function(status, reply){
status.should.eql(200)
reply.should.have.property("reset", true)
done()
})
})
Expand Down

0 comments on commit b8fbed8

Please sign in to comment.