MCPcopy Create free account
hub / github.com/bytebase/bytebase / SendSignal

Method SendSignal

backend/store/signal.go:16–27  ·  view source on GitHub ↗

SendSignal sends a notification to the bytebase_signal channel.

(ctx context.Context, signalType storepb.Signal_Type, projectID string, uid int64)

Source from the content-addressed store, hash-verified

14
15// SendSignal sends a notification to the bytebase_signal channel.
16func (s *Store) SendSignal(ctx context.Context, signalType storepb.Signal_Type, projectID string, uid int64) error {
17 payload, err := protojson.Marshal(&storepb.Signal{
18 Type: signalType,
19 Uid: uid,
20 Project: projectID,
21 })
22 if err != nil {
23 return errors.Wrap(err, "failed to marshal signal payload")
24 }
25 _, err = s.GetDB().ExecContext(ctx, "SELECT pg_notify($1, $2)", SignalChannel, string(payload))
26 return errors.Wrap(err, "failed to send signal")
27}

Callers 2

BatchCancelTaskRunsMethod · 0.80
CancelPlanCheckRunMethod · 0.80

Calls 1

GetDBMethod · 0.95

Tested by

no test coverage detected