refactor: use nginx -s reload instead of systemd

- doc: add comment
This commit is contained in:
2026-08-17 10:10:14 +08:00
parent 79f18fcdea
commit f536987a7e
62 changed files with 2216 additions and 598 deletions
+11 -5
View File
@@ -6,21 +6,27 @@ import (
)
var (
ErrNotFound = errors.New("transaction record not found")
ErrActiveExists = errors.New("an unfinished transaction already exists")
ErrStepConflict = errors.New("step key already refers to different intent")
ErrStepNotPending = errors.New("step is not waiting for an execution result")
ErrNotFound = errors.New("transaction record not found") // 请求的事务记录不存在。
ErrActiveExists = errors.New("an unfinished transaction already exists") // 已存在一条未结束的事务,阻塞新事务创建。
ErrStepConflict = errors.New("step key already refers to different intent") // 同一 step key 已被不同意图占用。
ErrStepNotPending = errors.New("step is not waiting for an execution result") // 步骤不处于等待执行结果的待定状态。
)
// ActiveTransactionError 告知调用方当前阻塞新请求的事务。
//
// 当尝试创建新事务却发现数据库中仍存在未结束事务时返回,TransactionID 指向
// 那条正在占用单活动事务槽位的已有事务。其 Unwrap 返回 ErrActiveExists
// 因此调用方既可用 errors.Is 判断大类,也可用 errors.As 取出具体事务 ID。
type ActiveTransactionError struct {
TransactionID string
TransactionID string // 当前阻塞新请求的未结束事务 ID。
}
// Error 返回带事务 ID 的阻塞错误描述。
func (e *ActiveTransactionError) Error() string {
return fmt.Sprintf("%s: %s", ErrActiveExists, e.TransactionID)
}
// Unwrap 返回底层哨兵错误 ErrActiveExists,支持 errors.Is 判定。
func (e *ActiveTransactionError) Unwrap() error {
return ErrActiveExists
}