diff options
| author | Shulhan <ms@kilabit.info> | 2025-05-31 17:09:55 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-05-31 17:09:55 +0700 |
| commit | 2e3c8f4cdc8d81b6a2f4842d849a64d7ce3d3926 (patch) | |
| tree | 12817c509614cdf24643b5305d1cb80eef1a860f | |
| parent | fea6f2115088c676902a22e154562e36acc3eaa1 (diff) | |
| download | jarink-2e3c8f4cdc8d81b6a2f4842d849a64d7ce3d3926.tar.xz | |
all: use case with ticker instead of default case in run
| -rw-r--r-- | worker.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |
