Add context
This commit adds and passes context around to (almost) every function. This allows cancelling (almost) every function call globally.
This commit is contained in:
parent
996ecb9f80
commit
3455f491ca
104 changed files with 836 additions and 511 deletions
|
|
@ -40,14 +40,14 @@ func (rb rebuild) Run(context wisski_distillery.Context) error {
|
|||
dis := context.Environment
|
||||
|
||||
// find the instances
|
||||
wissKIs, err := dis.Instances().Load(rb.Positionals.Slug...)
|
||||
wissKIs, err := dis.Instances().Load(context.Context, rb.Positionals.Slug...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// and do the actual rebuild
|
||||
return status.StreamGroup(context.IOStream, rb.Parallel, func(instance *wisski.WissKI, io stream.IOStream) error {
|
||||
return instance.Barrel().Build(io, true)
|
||||
return instance.Barrel().Build(context.Context, io, true)
|
||||
}, wissKIs, status.SmartMessage(func(item *wisski.WissKI) string {
|
||||
return fmt.Sprintf("rebuild %q", item.Slug)
|
||||
}))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue