Skip to content

Commit

Permalink
fixes issue ryanramage#9. Move the index name out of selectn
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanramage committed Jul 19, 2016
1 parent 4a3a394 commit 592294e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ function getSince (config, index_name, cb) {
if (config.since) return cb(null, config.since)
jsonist.get(config.seq_url, function (err, data) {
if (err) return cb(err)
var seq = selectn(index_name + '.mappings.seq._meta.seq', data)
if (!data[index_name]) return cb('index name does not match')
var seq = selectn('mappings.seq._meta.seq', data[index_name])
if (!seq) return cb('no seq number in elasticsearch at ' + config.seq_url)
return cb(null, seq)
})
Expand Down

0 comments on commit 592294e

Please sign in to comment.