feat: add runner failover policies and traces
This commit is contained in:
@@ -134,6 +134,28 @@ WHERE id = $1::uuid`, platformID, cooldownSeconds)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Store) DemoteCandidatePlatformPriority(ctx context.Context, platformID string, demoteStep int) error {
|
||||
if strings.TrimSpace(platformID) == "" {
|
||||
return nil
|
||||
}
|
||||
if demoteStep <= 0 {
|
||||
demoteStep = 100
|
||||
}
|
||||
_, err := s.pool.Exec(ctx, `
|
||||
UPDATE integration_platforms target
|
||||
SET dynamic_priority = GREATEST(
|
||||
COALESCE(target.dynamic_priority, target.priority),
|
||||
COALESCE((
|
||||
SELECT MAX(COALESCE(peer.dynamic_priority, peer.priority))
|
||||
FROM integration_platforms peer
|
||||
WHERE peer.deleted_at IS NULL
|
||||
), target.priority) + $2::int
|
||||
),
|
||||
updated_at = now()
|
||||
WHERE target.id = $1::uuid`, platformID, demoteStep)
|
||||
return err
|
||||
}
|
||||
|
||||
func scanRuntimePolicySet(scanner runtimePolicyScanner) (RuntimePolicySet, error) {
|
||||
var item RuntimePolicySet
|
||||
var rateLimitPolicy []byte
|
||||
|
||||
Reference in New Issue
Block a user