mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-11-18 03:11:24 +00:00
Make DynamoDB table configurable for locking and remove unnecessary signal for exec
This commit is contained in:
parent
df5c351b7f
commit
d0460edd69
@ -38,7 +38,6 @@ import (
|
||||
"fmt"
|
||||
"github.com/google/uuid"
|
||||
"go.temporal.io/sdk/activity"
|
||||
"golang.org/x/sys/unix"
|
||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||
"io"
|
||||
"io/fs"
|
||||
@ -56,7 +55,6 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -692,9 +690,6 @@ func (c *Controller) BuildArchActivity(ctx context.Context, projectId string, pa
|
||||
cmd := exec.Command("/bundle/fork-exec.py", args...)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
Pdeathsig: unix.SIGTERM,
|
||||
}
|
||||
err = cmd.Run()
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not mock build: %v", err)
|
||||
|
@ -46,7 +46,6 @@ import (
|
||||
"github.com/go-git/go-git/v5/plumbing"
|
||||
"github.com/rocky-linux/srpmproc/pkg/srpmproc"
|
||||
"go.temporal.io/sdk/activity"
|
||||
"golang.org/x/sys/unix"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||
"io"
|
||||
@ -58,7 +57,6 @@ import (
|
||||
peridotpb "peridot.resf.org/peridot/pb"
|
||||
"peridot.resf.org/peridot/rpmbuild"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -448,9 +446,6 @@ func (c *Controller) BuildSRPMActivity(ctx context.Context, upstreamPrefix strin
|
||||
cmd := exec.Command("/bundle/fork-exec.py", args...)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
Pdeathsig: unix.SIGTERM,
|
||||
}
|
||||
err = cmd.Run()
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not mock build: %v", err)
|
||||
|
@ -43,6 +43,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/gobwas/glob"
|
||||
"github.com/google/uuid"
|
||||
"github.com/spf13/viper"
|
||||
"go.temporal.io/sdk/activity"
|
||||
"go.temporal.io/sdk/temporal"
|
||||
"go.temporal.io/sdk/workflow"
|
||||
@ -518,7 +519,7 @@ func (c *Controller) UpdateRepoActivity(ctx context.Context, req *UpdateRepoRequ
|
||||
|
||||
lock, err := dynamolock.New(
|
||||
c.dynamodb,
|
||||
"peridot-repo-revision-lock",
|
||||
viper.GetString("dynamodb-table"),
|
||||
dynamolock.WithLeaseDuration(10*time.Second),
|
||||
dynamolock.WithHeartbeatPeriod(3*time.Second),
|
||||
)
|
||||
|
@ -66,6 +66,7 @@ func init() {
|
||||
cnf.Name = "yumrepofsupdater"
|
||||
|
||||
peridotcommon.AddFlags(root.PersistentFlags())
|
||||
root.PersistentFlags().String("dynamodb-table", "peridot-repo-revision-lock", "DynamoDB table name")
|
||||
utils.AddFlags(root.PersistentFlags(), cnf)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user