Skip to content

Commit 72b4afd

Browse files
committed
fixup configcat stuck
1 parent 470749f commit 72b4afd

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

components/common-go/experiments/types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ func WithGitpodProxy(gitpodHost string) ClientOpt {
4949
}
5050
}
5151

52+
func WithPollInterval(interval time.Duration) ClientOpt {
53+
return func(o *options) {
54+
o.pollInterval = interval
55+
}
56+
}
57+
5258
func WithDefaultClient(defaultClient Client) ClientOpt {
5359
return func(o *options) {
5460
o.defaultClient = defaultClient

components/service-waiter/cmd/component.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func init() {
154154
func startWaitFeatureFlag(ctx context.Context, timeout time.Duration) {
155155
featureFlagCtx, cancel := context.WithTimeout(ctx, timeout)
156156
defer cancel()
157-
client := experiments.NewClient(experiments.WithDefaultClient(nil))
157+
client := experiments.NewClient(experiments.WithDefaultClient(nil), experiments.WithPollInterval(time.Second*3))
158158
defaultSkip := true
159159
if client == nil {
160160
log.Error("failed to create experiments client, skip immediately")

components/service-waiter/pkg/metrics/metrics.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,16 @@ func addCounter(host, metricName string, labels map[string]string) {
3636
b, err := json.Marshal(body)
3737
if err != nil {
3838
log.WithError(err).Error("cannot marshal body")
39+
return
3940
}
4041
resp, err := http.Post(host+"/metrics-api/metrics/counter/add/"+metricName, "application/json", bytes.NewReader(b))
4142
if err != nil {
4243
log.WithError(err).Error("cannot post metrics")
44+
return
4345
}
46+
defer resp.Body.Close()
4447
if resp.StatusCode != http.StatusOK {
4548
log.WithField("status", resp.Status).Error("failed to post metrics")
4649
}
47-
defer resp.Body.Close()
50+
log.Info("metric reported")
4851
}

install/installer/pkg/components/ide-metrics/networkpolicy.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ func networkpolicy(ctx *common.RenderContext) ([]runtime.Object, error) {
4141
PodSelector: &metav1.LabelSelector{MatchLabels: map[string]string{
4242
"component": ideproxy.Component,
4343
}},
44+
}, {
45+
PodSelector: &metav1.LabelSelector{MatchLabels: map[string]string{
46+
"component": common.DashboardComponent,
47+
}},
4448
}},
4549
}},
4650
},

0 commit comments

Comments
 (0)