Skip to content

Commit

Permalink
Fix duplicating creating.
Browse files Browse the repository at this point in the history
  • Loading branch information
googollee committed Apr 11, 2024
1 parent 12ba111 commit 6033697
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion module/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ func (r *Repo) InjectTo(ctx context.Context) (context.Context, error) {
r.locker.RUnlock()

if needCreating {
var err error

r.locker.Lock()
err := r.buildValues(ctx)
if len(r.instances) == 0 {
err = r.buildValues(ctx)
}
r.locker.Unlock()

if err != nil {
Expand Down

0 comments on commit 6033697

Please sign in to comment.