Skip to content

Commit

Permalink
feature(user_group): support cdp cohort handler and user group experi…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
lixinyang-cyril committed Jun 3, 2024
1 parent beec3a4 commit a1af6f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cohort/cdp_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ func (c *CdpClient) UseCohort(decisionId string, cohortIds []string) []string {
// gen req
var cohortIdStrBuilder strings.Builder
cohortIdStrBuilder.WriteString(cohortIds[0])
cohortIdMap := make(map[string]bool)
cohortIdMap[cohortIds[0]] = true
for _, id := range cohortIds[1:] {
if cohortIdMap[id] { // 去重
continue
}
cohortIdMap[id] = true
cohortIdStrBuilder.WriteString(",")
cohortIdStrBuilder.WriteString(id)
}
Expand Down
1 change: 1 addition & 0 deletions meta/manager/dynamic_meta_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func NewDynamicMetaManager(token string, options ...MetaOptionFunc) *DynamicMeta
}
if err := d.fetchMeta(); err != nil {
log.WithFields(log.Fields{"url": d.fetchUrl, "err": err}).Error("fetch meta err")
return &d
}
d.startFetcher()
return &d
Expand Down

0 comments on commit a1af6f7

Please sign in to comment.