forked from rosa/hakurei
cmd/app: expose scheduling configuration
Useful for the music player. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"hakurei.app/check"
|
"hakurei.app/check"
|
||||||
|
"hakurei.app/ext"
|
||||||
"hakurei.app/fhs"
|
"hakurei.app/fhs"
|
||||||
"hakurei.app/hst"
|
"hakurei.app/hst"
|
||||||
)
|
)
|
||||||
@@ -192,6 +193,20 @@ func parse(
|
|||||||
c.Groups = append(c.Groups, value)
|
c.Groups = append(c.Groups, value)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
case "sched_policy":
|
||||||
|
if err := c.SchedPolicy.UnmarshalText([]byte(value)); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
|
||||||
|
case "sched_priority":
|
||||||
|
v, err := strconv.Atoi(value)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
c.SchedPriority = ext.Int(v)
|
||||||
|
continue
|
||||||
|
|
||||||
case "env":
|
case "env":
|
||||||
if key, value, ok = strings.Cut(value, "="); !ok {
|
if key, value, ok = strings.Cut(value, "="); !ok {
|
||||||
return nil, fmt.Errorf("invalid environment %q", key)
|
return nil, fmt.Errorf("invalid environment %q", key)
|
||||||
|
|||||||
Reference in New Issue
Block a user