Skip to content

Commit

Permalink
fix dupulicate assets url
Browse files Browse the repository at this point in the history
Signed-off-by: YZ775 <yuzuki-mimura@cybozu.co.jp>
  • Loading branch information
YZ775 committed Dec 4, 2023
1 parent 1d898ce commit cd2f1f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions models/etcd/asset_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"math/rand"
"net/http"
"slices"
"strconv"
"time"

Expand Down Expand Up @@ -41,6 +42,10 @@ RETRY:
return nil
}

if slices.Contains(a.URLs, d.myURL("/api/v1/assets", a.Name)) {
return nil
}

a.URLs = append(a.URLs, d.myURL("/api/v1/assets", a.Name))
key := KeyAssets + a.Name

Expand Down

0 comments on commit cd2f1f3

Please sign in to comment.