MCPcopy Create free account
hub / github.com/Chatterino/api / commit

Method commit

pkg/cache/db.go:405–422  ·  view source on GitHub ↗
(ctx context.Context, parentKey string)

Source from the content-addressed store, hash-verified

403}
404
405func (c *PostgreSQLDependentCache) commit(ctx context.Context, parentKey string) error {
406 log := logger.FromContext(ctx)
407
408 _, err := c.pool.Exec(
409 ctx,
410 "UPDATE dependent_values SET committed = TRUE WHERE parent_key = $1 AND NOT committed",
411 parentKey,
412 )
413 if err != nil {
414 log.Errorw("Error committing dependent values",
415 "parentKey", parentKey,
416 "err", err,
417 )
418 return err
419 }
420
421 return nil
422}
423
424func (c *PostgreSQLDependentCache) rollback(ctx context.Context, parentKey string) error {
425 log := logger.FromContext(ctx)

Callers

nothing calls this directly

Calls 3

FromContextFunction · 0.92
ExecMethod · 0.65
ErrorwMethod · 0.65

Tested by

no test coverage detected