Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/woanware/lookuper
Browse files Browse the repository at this point in the history
  • Loading branch information
woanware committed Oct 31, 2016
2 parents d4e2fbd + 1d0da74 commit 1d3e596
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions source/src/woanware/lookuper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ var (
// ##### Constants ############################################################

const APP_NAME string = "lookuper"
<<<<<<< HEAD
const APP_VERSION string = "0.0.5"
=======
const APP_VERSION string = "0.0.4"
>>>>>>> 1d0da74eb00a9757f1c98adcb821d7fdb525d886
const DB_FILE_NAME string = "./lookuper.db"
const CONFIG_FILE_NAME string = "./lookuper.config"

Expand Down
11 changes: 7 additions & 4 deletions source/src/woanware/lookuper/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ func (w *Worker) Run(
apiKeys []string,
privateApiKeys bool) {

log.Printf("Data type: %s", dataTypes[dataType])

count, err := w.getWorkTableRecordCount()
if err != nil {
log.Printf("Error checking for existing work: %v", err)
Expand Down Expand Up @@ -258,11 +256,16 @@ func (w *Worker) process(apiKey string) int8 {

var responseCode int8
var batchData BatchData

var percent float64
for {
batchData = w.loadBatch(batchSize)
if len(batchData.Items) == 0 {
break
break
}

if w.numberComplete % 5 == 0 {
percent = float64(w.numberComplete) * float64(100) / float64(w.numberTotal)
log.Printf("Percent Complete: %d", int(percent))
}

responseCode = w.processBatch(apiKey, batchData)
Expand Down

0 comments on commit 1d3e596

Please sign in to comment.