internal/pkg: consolidate cache attributes
Test / Create distribution (push) Successful in 54s
Test / Sandbox (push) Successful in 2m58s
Test / ShareFS (push) Successful in 3m56s
Test / Hakurei (push) Successful in 3m59s
Test / Sandbox (race detector) (push) Successful in 5m31s
Test / Hakurei (race detector) (push) Successful in 6m38s
Test / Flake checks (push) Successful in 1m5s
Test / Create distribution (push) Successful in 54s
Test / Sandbox (push) Successful in 2m58s
Test / ShareFS (push) Successful in 3m56s
Test / Hakurei (push) Successful in 3m59s
Test / Sandbox (race detector) (push) Successful in 5m31s
Test / Hakurei (race detector) (push) Successful in 6m38s
Test / Flake checks (push) Successful in 1m5s
This makes the interface stable. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
+6
-9
@@ -21,7 +21,7 @@ type cache struct {
|
||||
// Should generally not be used directly.
|
||||
c *pkg.Cache
|
||||
|
||||
cures, jobs int
|
||||
attr pkg.CacheAttr
|
||||
// Primarily to work around missing landlock LSM.
|
||||
hostAbstract bool
|
||||
// Set SCHED_IDLE.
|
||||
@@ -49,18 +49,17 @@ func (cache *cache) open() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
var flags int
|
||||
if cache.idle {
|
||||
flags |= pkg.CSchedIdle
|
||||
cache.attr.Flags |= pkg.CSchedIdle
|
||||
}
|
||||
if cache.hostAbstract {
|
||||
flags |= pkg.CHostAbstract
|
||||
cache.attr.Flags |= pkg.CHostAbstract
|
||||
}
|
||||
if !cache.verboseInit {
|
||||
flags |= pkg.CSuppressInit
|
||||
cache.attr.Flags |= pkg.CSuppressInit
|
||||
}
|
||||
if !cache.deep {
|
||||
flags |= pkg.CExternShallow
|
||||
cache.attr.Flags |= pkg.CExternShallow
|
||||
}
|
||||
|
||||
done := make(chan struct{})
|
||||
@@ -82,10 +81,8 @@ func (cache *cache) open() (err error) {
|
||||
cache.c, err = pkg.Open(
|
||||
cache.ctx,
|
||||
cache.msg,
|
||||
flags,
|
||||
cache.cures,
|
||||
cache.jobs,
|
||||
base,
|
||||
&cache.attr,
|
||||
)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user