File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ function getExchanges(req, res) {
80
80
} else if ( options . reduce && options . interval ) {
81
81
return { error : 'cannot use reduce with interval' , code : 400 }
82
82
} else if ( options . reduce ) {
83
- options . limit = req . query . limit ? options . limit : 50000
83
+ options . limit = 10000
84
84
} else if ( options . limit > 1000 ) {
85
85
options . limit = 1000
86
86
} else if ( options . interval &&
@@ -234,8 +234,15 @@ function getExchanges(req, res) {
234
234
log . info ( params . base . currency , params . counter . currency )
235
235
236
236
hbase . getExchanges ( params , function ( err , resp ) {
237
- if ( err ) {
237
+ if ( err && err === 'too many rows' ) {
238
+ errorResponse ( {
239
+ code : 400 ,
240
+ error : 'too many exchanges, use a smaller interval'
241
+ } )
242
+
243
+ } else if ( err ) {
238
244
errorResponse ( err )
245
+
239
246
} else if ( params . reduce ) {
240
247
formatInterval ( resp . reduced )
241
248
resp . rows = [ resp . reduced ]
Original file line number Diff line number Diff line change @@ -1487,7 +1487,15 @@ HbaseClient.getExchanges = function(options, callback) {
1487
1487
} , function ( err , resp ) {
1488
1488
var result
1489
1489
1490
- if ( resp ) {
1490
+ if ( resp &&
1491
+ options . reduce &&
1492
+ options . limit &&
1493
+ resp . rows . length === options . limit &&
1494
+ resp . marker ) {
1495
+ callback ( 'too many rows' )
1496
+ return
1497
+
1498
+ } else if ( resp ) {
1491
1499
result = resp
1492
1500
} else {
1493
1501
result = {
You can’t perform that action at this time.
0 commit comments