fix: harden signature cache publication

This commit is contained in:
Samuel Cui
2026-08-31 22:36:12 +08:00
parent cc5248ea33
commit d097ca107d
7 changed files with 132 additions and 67 deletions
+7 -1
View File
@@ -1,17 +1,23 @@
package acp
import "fmt"
type deviceOption struct {
linear bool
threads int
}
func (do *deviceOption) check() {
func (do *deviceOption) check() error {
if do.threads < 0 {
return fmt.Errorf("device threads cannot be negative, threads=%d", do.threads)
}
if do.threads == 0 {
do.threads = 8
}
if do.linear {
do.threads = 1
}
return nil
}
type DeviceOption func(*deviceOption) *deviceOption