MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / MarkOutboxCompleted

Method MarkOutboxCompleted

database/lineage.go:352–362  ·  view source on GitHub ↗

MarkOutboxCompleted marks an outbox entry as completed.

(ctx context.Context, id int64)

Source from the content-addressed store, hash-verified

350
351// MarkOutboxCompleted marks an outbox entry as completed.
352func (d Datasource) MarkOutboxCompleted(ctx context.Context, id int64) error {
353 _, err := d.Conn.ExecContext(ctx, `
354 UPDATE ledgerforge.lineage_outbox
355 SET status = $1, processed_at = NOW(), locked_until = NULL
356 WHERE id = $2
357 `, model.OutboxStatusCompleted, id)
358 if err != nil {
359 return apierror.NewAPIError(apierror.ErrInternalServer, "Failed to mark outbox entry as completed", err)
360 }
361 return nil
362}
363
364// MarkOutboxFailed marks an outbox entry as failed and increments the attempt counter.
365// If attempts exceed max_attempts, the status becomes 'failed', otherwise it returns to 'pending' for retry.

Callers

nothing calls this directly

Calls 1

NewAPIErrorFunction · 0.92

Tested by

no test coverage detected