检查点:保存请求取消栅栏与监听保护,准备补齐Linux发布包

This commit is contained in:
xuans committed 2026-09-20 01:37:49 +08:00
1 parent 76b4d94ca0
commit 822e204ae0
16 files changed
+685 -51

No files matched your search

@@ -55,6 +55,10 @@ func (r Rotation) Stage(ctx context.Context, chain, key []byte) (id string, resu
}
defer root.Close()
defer lock.Close()
return r.stage(ctx, root, "", chain, key)
}
func (r Rotation) stage(ctx context.Context, root *os.Root, id string, chain, key []byte) (_ string, resultErr error) {
previous, err := readTransaction(root)
if err != nil && !errors.Is(err, os.ErrNotExist) {
return "", err
@@ -87,9 +91,11 @@ func (r Rotation) Stage(ctx context.Context, chain, key []byte) (id string, resu
if err := r.Reloader.Check(ctx); err != nil {
return "", fmt.Errorf("Nginx 原配置检查失败:%w", err)
}
id, err = newID()
if err != nil {
return "", err
if id == "" {
id, err = newID()
if err != nil {
return "", err
}
}
if err := root.Mkdir(id, 0o700); err != nil {
return "", err