Skip to content

Commit

Permalink
Merge branch 'main' into alerting-v1-evervigil
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal authored Dec 11, 2023
2 parents 78c46e5 + 77cd516 commit 523c80b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 122 deletions.
16 changes: 16 additions & 0 deletions flow/cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package main

import (
"context"

"github.com/PeerDB-io/peer-flow/connectors/utils"
"github.com/PeerDB-io/peer-flow/generated/protos"
)

func (h *FlowRequestHandler) GetVersion(
ctx context.Context,
req *protos.PeerDBVersionRequest,
) (*protos.PeerDBVersionResponse, error) {
version := utils.GetEnvString("PEERDB_VERSION_SHA_SHORT", "unknown")
return &protos.PeerDBVersionResponse{Version: version}, nil
}
60 changes: 0 additions & 60 deletions flow/connectors/postgres/bench_test.sql

This file was deleted.

28 changes: 0 additions & 28 deletions flow/connectors/postgres/qrep_partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
util "github.com/PeerDB-io/peer-flow/utils"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/stretchr/testify/assert"
"google.golang.org/protobuf/types/known/timestamppb"
)

type testCase struct {
Expand Down Expand Up @@ -60,33 +59,6 @@ func newTestCaseForCTID(schema string, name string, rows uint32, expectedNum int
}
}

func (tc *testCase) appendPartition(start time.Time, end time.Time) *testCase {
tsRange := &protos.PartitionRange_TimestampRange{
TimestampRange: &protos.TimestampPartitionRange{
Start: timestamppb.New(start),
End: timestamppb.New(end),
},
}
tc.want = append(tc.want, &protos.QRepPartition{
PartitionId: "test_uuid",
Range: &protos.PartitionRange{
Range: tsRange,
},
})
return tc
}

func (tc *testCase) appendPartitions(start, end time.Time, numPartitions int) *testCase {
duration := end.Sub(start)
partitionDuration := duration / time.Duration(numPartitions)
for i := 0; i < numPartitions; i++ {
partitionStart := start.Add(time.Duration(i) * partitionDuration)
partitionEnd := start.Add(time.Duration(i+1) * partitionDuration)
tc.appendPartition(partitionStart, partitionEnd)
}
return tc
}

func TestGetQRepPartitions(t *testing.T) {
// log.SetLevel(log.DebugLevel)

Expand Down
9 changes: 0 additions & 9 deletions flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,6 @@ func CDCFlowWorkflowWithConfig(
state.Progress = append(state.Progress, "executed setup flow and snapshot flow")
}

heartbeatCancelCtx, cancelHeartbeat := workflow.WithCancel(ctx)
walHeartbeatCtx := workflow.WithActivityOptions(heartbeatCancelCtx, workflow.ActivityOptions{
StartToCloseTimeout: 7 * 24 * time.Hour,
})
workflow.ExecuteActivity(walHeartbeatCtx, flowable.SendWALHeartbeat, cfg)

syncFlowOptions := &protos.SyncFlowOptions{
BatchSize: int32(limits.MaxBatchSize),
}
Expand Down Expand Up @@ -443,9 +437,6 @@ func CDCFlowWorkflowWithConfig(
selector.Select(ctx)
}

// cancel the SendWalHeartbeat activity
defer cancelHeartbeat()

state.TruncateProgress()
return nil, workflow.NewContinueAsNewError(ctx, CDCFlowWorkflowWithConfig, cfg, limits, state)
}
12 changes: 1 addition & 11 deletions ui/app/mirrors/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,7 @@ export default async function Mirrors() {
<Header
variant='title2'
slot={
<Button
as={Link}
style={{
width: '10%',
height: '2rem',
fontSize: 17,
boxShadow: '0px 2px 4px rgba(0,0,0,0.2)',
}}
href={'/mirrors/create'}
variant='normalSolid'
>
<Button as={Link} href={'/mirrors/create'} variant='normalSolid'>
<div
style={{
display: 'flex',
Expand Down
16 changes: 2 additions & 14 deletions ui/app/peers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@ export default async function Peers() {
<Header
variant='title2'
slot={
<Button
as={Link}
style={{
width: '10%',
height: '2rem',
fontSize: 17,
boxShadow: '0px 2px 4px rgba(0,0,0,0.2)',
}}
href={'/peers/create'}
variant='normalSolid'
>
<Button as={Link} href={'/peers/create'} variant='normalSolid'>
<div
style={{
display: 'flex',
Expand All @@ -42,9 +32,7 @@ export default async function Peers() {
}}
>
<Icon name='add' />
<Label style={{ marginLeft: '0.5rem', fontSize: 15 }}>
New peer
</Label>
<Label>New peer</Label>
</div>
</Button>
}
Expand Down

0 comments on commit 523c80b

Please sign in to comment.