MCPcopy
hub / github.com/wavetermdev/waveterm / ContextUpdatesRollbackTx

Function ContextUpdatesRollbackTx

pkg/waveobj/ctxupdate.go:115–125  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

113}
114
115func ContextUpdatesRollbackTx(ctx context.Context) {
116 updatesVal := ctx.Value(waveObjUpdateKey)
117 if updatesVal == nil {
118 return
119 }
120 updates := updatesVal.(*contextUpdatesType)
121 if len(updates.UpdatesStack) <= 1 {
122 panic(fmt.Errorf("no updates transaction to rollback"))
123 }
124 updates.UpdatesStack = updates.UpdatesStack[:len(updates.UpdatesStack)-1]
125}
126
127func ContextGetUpdatesRtn(ctx context.Context) UpdatesRtnType {
128 updatesMap := ContextGetUpdates(ctx)

Callers 2

WithTxFunction · 0.92
WithTxRtnFunction · 0.92

Calls 1

ValueMethod · 0.80

Tested by

no test coverage detected