MCPcopy Create free account
hub / github.com/cloudwan/gohan / UpdateContext

Method UpdateContext

server/transaction_commit_informer.go:137–150  ·  view source on GitHub ↗
(ctx context.Context, resource *schema.Resource)

Source from the content-addressed store, hash-verified

135}
136
137func (tl *transactionEventLogger) UpdateContext(ctx context.Context, resource *schema.Resource) error {
138 err := tl.Transaction.UpdateContext(ctx, resource)
139 if err != nil {
140 return err
141 }
142 if !resource.Schema().StateVersioning() {
143 return tl.logEvent(ctx, "update", resource, 0)
144 }
145 state, err := tl.StateFetch(resource.Schema(), transaction.IDFilter(resource.ID()))
146 if err != nil {
147 return err
148 }
149 return tl.logEvent(ctx, "update", resource, state.ConfigVersion)
150}
151
152func (tl *transactionEventLogger) Resync(resource *schema.Resource) error {
153 if !resource.Schema().StateVersioning() {

Callers 1

UpdateMethod · 0.95

Calls 6

logEventMethod · 0.95
StateVersioningMethod · 0.80
UpdateContextMethod · 0.65
SchemaMethod · 0.65
StateFetchMethod · 0.65
IDMethod · 0.65

Tested by

no test coverage detected