mirror of
https://github.com/samuelncui/acp.git
synced 2026-09-20 14:34:16 +00:00
fix: harden signature cache publication
This commit is contained in:
+7
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user