Skip to content

Commit 33f0b33

Browse files
committed
fix: [#2 + sleep] correctly handle sleep
1 parent 110cc29 commit 33f0b33

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

main.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,12 @@ func main() {
175175
// pop redis queue
176176
for {
177177
err := errors.New("")
178-
jsonPath, err = redis.String(cr.Do("LPOP", "analyzer:"+c.redisQueue))
178+
jsonPath, err = redis.String(cr.Do("LPOP", "analyzer:ja3-jl:"+c.redisQueue))
179179
if err != nil {
180180
time.Sleep(30 * time.Second)
181+
} else {
182+
processFile(c.certPath, jsonPath)
181183
}
182-
processFile(c.certPath, jsonPath)
183184

184185
// Exit Signal Handle
185186
select {
@@ -439,8 +440,8 @@ func insertCertificate(fp string, c certMapElm) (string, error) {
439440
if err != nil {
440441
return c.CertHash, err
441442
}
442-
fmt.Println(c.CertHash)
443-
fmt.Println(key)
443+
//fmt.Println(c.CertHash)
444+
//fmt.Println(key)
444445
q = `INSERT INTO "many_certificate_has_many_public_key" ("hash_certificate", "hash_public_key") VALUES ($1, $2) ON CONFLICT DO NOTHING `
445446
_, err = db.Exec(q, c.CertHash, key)
446447
if err != nil {

0 commit comments

Comments
 (0)