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
|
|
@ -37,14 +37,14 @@ var errPrefixUpdateFailed = exit.Error{
|
|||
func (upc updateprefixconfig) Run(context wisski_distillery.Context) error {
|
||||
dis := context.Environment
|
||||
|
||||
wissKIs, err := dis.Instances().All()
|
||||
wissKIs, err := dis.Instances().All(context.Context)
|
||||
if err != nil {
|
||||
return errPrefixUpdateFailed.Wrap(err)
|
||||
}
|
||||
|
||||
return status.StreamGroup(context.IOStream, upc.Parallel, func(instance *wisski.WissKI, io stream.IOStream) error {
|
||||
io.Println("reading prefixes")
|
||||
err := instance.Prefixes().Update()
|
||||
err := instance.Prefixes().Update(context.Context)
|
||||
if err != nil {
|
||||
return errPrefixUpdateFailed.Wrap(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue