Do not try to call syscall.Kill on Windows (#2986)
Will create a followup to make sure we are doing the right thing on Windows. This will unblock builds for now, although we don't get the metrics for Windows(which was not working anyways). --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [x] 🕐 Yes, but in a later PR - [ ] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [x] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> #### Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
03edc603da
commit
d99b125087
@ -6,7 +6,6 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/alcionai/clues"
|
||||
@ -234,12 +233,6 @@ func dumpMetrics(ctx context.Context, stop <-chan struct{}, sig *metrics.InmemSi
|
||||
}
|
||||
}
|
||||
|
||||
func signalDump(ctx context.Context) {
|
||||
if err := syscall.Kill(syscall.Getpid(), metrics.DefaultSignal); err != nil {
|
||||
logger.CtxErr(ctx, err).Error("metrics interval signal")
|
||||
}
|
||||
}
|
||||
|
||||
// Inc increments the given category by 1.
|
||||
func Inc(cat m, keys ...string) {
|
||||
cats := append([]string{string(cat)}, keys...)
|
||||
|
||||
19
src/internal/events/events_signal_unix.go
Normal file
19
src/internal/events/events_signal_unix.go
Normal file
@ -0,0 +1,19 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
|
||||
package events
|
||||
|
||||
import (
|
||||
"context"
|
||||
"syscall"
|
||||
|
||||
"github.com/armon/go-metrics"
|
||||
|
||||
"github.com/alcionai/corso/src/pkg/logger"
|
||||
)
|
||||
|
||||
func signalDump(ctx context.Context) {
|
||||
if err := syscall.Kill(syscall.Getpid(), metrics.DefaultSignal); err != nil {
|
||||
logger.CtxErr(ctx, err).Error("metrics interval signal")
|
||||
}
|
||||
}
|
||||
11
src/internal/events/events_signal_windows.go
Normal file
11
src/internal/events/events_signal_windows.go
Normal file
@ -0,0 +1,11 @@
|
||||
package events
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/alcionai/corso/src/pkg/logger"
|
||||
)
|
||||
|
||||
func signalDump(ctx context.Context) {
|
||||
logger.Ctx(ctx).Warn("cannot send signal on Windows")
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user