aboutsummaryrefslogtreecommitdiff
path: root/worker.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-05-31 17:09:55 +0700
committerShulhan <ms@kilabit.info>2025-05-31 17:09:55 +0700
commit2e3c8f4cdc8d81b6a2f4842d849a64d7ce3d3926 (patch)
tree12817c509614cdf24643b5305d1cb80eef1a860f /worker.go
parentfea6f2115088c676902a22e154562e36acc3eaa1 (diff)
downloadjarink-2e3c8f4cdc8d81b6a2f4842d849a64d7ce3d3926.tar.xz
all: use case with ticker instead of default case in run
Diffstat (limited to 'worker.go')
-rw-r--r--worker.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/worker.go b/worker.go
index 6bc5c13..e9ff6bd 100644
--- a/worker.go
+++ b/worker.go
@@ -98,6 +98,7 @@ func (wrk *worker) run() (result *Result, err error) {
go wrk.scan(linkq)
}
+ var tick = time.NewTicker(500 * time.Millisecond)
var listWaitStatus []linkQueue
var isScanning = true
for isScanning {
@@ -149,7 +150,7 @@ func (wrk *worker) run() (result *Result, err error) {
listWaitStatus = append(listWaitStatus, linkq)
}
- default:
+ case <-tick.C:
wrk.wg.Wait()
if len(wrk.resultq) != 0 {
continue