You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// On CI, always block on metricssend. This sucks, but the alternative is not getting metrics from CI at all. There are timeouts in place to prevent this from taking more than 15 seconds
34
38
35
-
buffer:= bytes.Buffer{}
36
-
buffer.Write(json)
39
+
ifiostream.IsInteractive() {
40
+
flyctl, err:=os.Executable()
41
+
iferr!=nil {
42
+
returnerr
43
+
}
37
44
38
-
cmd.Stdin=&buffer
39
-
cmd.Env=os.Environ()
45
+
cmd:=exec.Command(flyctl, "metrics", "send")
46
+
stdin, err:=cmd.StdinPipe()
47
+
iferr!=nil {
48
+
returnerr
49
+
}
40
50
41
-
agent.SetSysProcAttributes(cmd)
51
+
gofunc() {
52
+
deferstdin.Close()
53
+
io.WriteString(stdin, string(json))
54
+
}()
42
55
43
-
iferr:=cmd.Start(); err!=nil {
44
-
returnerr
45
-
}
56
+
cmd.Env=os.Environ()
57
+
cmd.Env=append(cmd.Env, "FLY_NO_UPDATE_CHECK=1")
46
58
47
-
io:=iostreams.FromContext(ctx)
59
+
agent.SetSysProcAttributes(cmd)
48
60
49
-
// On CI, always block on metrics send. This sucks, but the alternative is not getting metrics from CI at all. There are timeouts in place to prevent this from taking more than 15 seconds
0 commit comments