fix: serialize delegations and repair verification
This commit is contained in:
1 parent
99fa5de747
commit
5f17aab6ca
8 files changed
+99
-43
No files matched your search
@@ -130,6 +130,7 @@ type webStore interface {
|
||||
ZoneExists(ctx context.Context, zone string) (bool, error)
|
||||
ListAudit(ctx context.Context, f auditFilter) ([]auditRow, error)
|
||||
InTx(ctx context.Context, fn func(tx webTx) error) error
|
||||
InZoneTx(ctx context.Context, zone string, log *slog.Logger, fn func(tx webTx) error) error
|
||||
}
|
||||
|
||||
type sqlWebTx struct {
|
||||
@@ -166,6 +167,14 @@ func (s *sqlWebStore) InTx(ctx context.Context, fn func(tx webTx) error) error {
|
||||
})
|
||||
}
|
||||
|
||||
func (s *sqlWebStore) InZoneTx(ctx context.Context, zone string, log *slog.Logger, fn func(tx webTx) error) error {
|
||||
return withZoneLock(ctx, s.db, s.tables, zone, log, func(conn *sql.Conn) error {
|
||||
return runInTx(ctx, conn, func(tx *sql.Tx) error {
|
||||
return fn(newSQLWebTx(tx, s.tables))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
func (c *apiContext) writeChangeAudit(ctx context.Context, tx *sql.Tx, status int) error {
|
||||
return c.writeChangeAuditWith(ctx, newAuditStore(tx, c.Server.tables), status)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user