This commit is contained in:
@@ -568,11 +568,9 @@ func (r *CapabilityRepository) SaveCognitiveDiscovery(ctx context.Context, value
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Discovery creates immutable binding revisions. The durable head must
|
// Discovery may advance a head, but must never roll back a governed
|
||||||
// follow the revision accepted by this transaction; leaving the
|
// CANARY/ACTIVE revision to an older discovered snapshot after restart.
|
||||||
// existing head untouched strands refreshed providers behind an older
|
_, err = tx.Exec(ctx, `INSERT INTO capability.cognitive_binding_revision_heads (binding_id,revision) VALUES ($1,$2) ON CONFLICT (binding_id) DO UPDATE SET revision=EXCLUDED.revision,updated_at=CURRENT_TIMESTAMP WHERE capability.cognitive_binding_revision_heads.revision < EXCLUDED.revision`, binding.ID, binding.Revision)
|
||||||
// inactive snapshot.
|
|
||||||
_, err = tx.Exec(ctx, `INSERT INTO capability.cognitive_binding_revision_heads (binding_id,revision) VALUES ($1,$2) ON CONFLICT (binding_id) DO UPDATE SET revision=EXCLUDED.revision,updated_at=CURRENT_TIMESTAMP`, binding.ID, binding.Revision)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user