Skip to content

Commit

Permalink
♻️ Fix
Browse files Browse the repository at this point in the history
Signed-off-by: vankichi <[email protected]>
  • Loading branch information
vankichi committed Sep 30, 2024
1 parent 68293e6 commit 8942da1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile.d/functions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ define gen-deadlink-checker
-tags "osusergo netgo static_build" \
-trimpath \
-o $$BIN_PATH $(ROOTDIR)/hack/tools/deadlink/main.go; \
$$BIN_PATH -path $3 -ignore-path $4 -format $5 $1; \
$$BIN_PATH -path $3 -ignore-path $4 -format $5 $1; \
rm -rf $$BIN_PATH
endef

13 changes: 8 additions & 5 deletions hack/tools/deadlink/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,19 +235,22 @@ func main() {
eg.Go(func() error {
for k, v := range url {
mu.Lock()
defer mu.Unlock()
if _, ok := r.errLinks[k]; ok {
atomic.AddInt32(&fail, 1)
mu.Unlock()
continue
}
var code int
if strings.Contains(v, BASE_URL) {
code = exec(v, cli)
} else if c, ok := exLinks[v]; ok {
code = c
} else {
code = exec(v, cli)
exLinks[v] = code
if c, ok := exLinks[v]; ok {
code = c
} else {
code = exec(v, cli)
exLinks[v] = code
}
mu.Unlock()
}
if code == 200 {
atomic.AddInt32(&success, 1)
Expand Down

0 comments on commit 8942da1

Please sign in to comment.