Remove deprecated syscall dependency.

This commit is contained in:
Maximilian Paß
2023-11-23 14:27:01 +01:00
committed by Sebastian Serth
parent 64412e1c4b
commit 8292b073e3
3 changed files with 6 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/openHPI/poseidon/internal/runner"
"github.com/openHPI/poseidon/pkg/logging"
"github.com/openHPI/poseidon/pkg/monitoring"
"golang.org/x/sys/unix"
"net/http"
"os"
"os/signal"
@@ -19,7 +20,6 @@ import (
"runtime/debug"
"runtime/pprof"
"strconv"
"syscall"
"time"
)
@@ -243,11 +243,11 @@ func initServer(ctx context.Context) *http.Server {
func shutdownOnOSSignal(server *http.Server, ctx context.Context, stopProfiling func()) {
// wait for SIGINT
shutdownSignals := make(chan os.Signal, 1)
signal.Notify(shutdownSignals, syscall.SIGINT, syscall.SIGTERM)
signal.Notify(shutdownSignals, unix.SIGINT, unix.SIGTERM)
// wait for SIGUSR1
writeProfileSignal := make(chan os.Signal, 1)
signal.Notify(writeProfileSignal, syscall.SIGUSR1)
signal.Notify(writeProfileSignal, unix.SIGUSR1)
select {
case <-ctx.Done():

View File

@@ -6,7 +6,7 @@ import (
"github.com/openHPI/poseidon/internal/runner"
"github.com/openHPI/poseidon/tests"
"github.com/stretchr/testify/suite"
"syscall"
"golang.org/x/sys/unix"
"testing"
"time"
)
@@ -57,7 +57,7 @@ func (s *MainTestSuite) TestShutdownOnOSSignal_Profiling() {
})
<-time.After(tests.ShortTimeout)
err := syscall.Kill(syscall.Getpid(), syscall.SIGUSR1)
err := unix.Kill(unix.Getpid(), unix.SIGUSR1)
s.Require().NoError(err)
<-time.After(tests.ShortTimeout)