Pass context to event publishing.

To allow tracing propagation via events, we need to pass the context
to the `Publish` function of reva events. This adds the context
everywhere where events are published. If there was no context to pass,
we started a new one with `context.Background()`.
This commit is contained in:
Daniël Franke
2023-08-10 11:42:37 +02:00
parent 6700214519
commit 952ebe7d7d
24 changed files with 86 additions and 61 deletions

View File

@@ -1,6 +1,7 @@
package command
import (
"context"
"time"
"github.com/cs3org/reva/v2/pkg/events"
@@ -38,7 +39,7 @@ func RestartPostprocessing(cfg *config.Config) *cli.Command {
Timestamp: utils.TSNow(),
}
if err := events.Publish(stream, ev); err != nil {
if err := events.Publish(context.Background(), stream, ev); err != nil {
return err
}