Skip to content

Commit

Permalink
make picky variable namers happy
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <jkoberg@owncloud.com>
  • Loading branch information
kobergj committed Sep 22, 2023
1 parent b59fec9 commit 586bae4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions services/clientlog/pkg/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ func (cl *ClientlogService) processEvent(event events.Event) {
}

var (
users []string
typ string
data interface{}
users []string
evType string
data interface{}
)
switch e := event.Event.(type) {
default:
Expand All @@ -101,7 +101,7 @@ func (cl *ClientlogService) processEvent(event events.Event) {
return
}

typ = "postprocessing-finished"
evType = "postprocessing-finished"
data = FileReadyEvent{
ItemID: storagespace.FormatResourceID(*info.GetId()),
}
Expand All @@ -116,22 +116,22 @@ func (cl *ClientlogService) processEvent(event events.Event) {

// II) instruct sse service to send the information
for _, id := range users {
if err := cl.sendSSE(id, typ, data); err != nil {
if err := cl.sendSSE(id, evType, data); err != nil {
cl.log.Error().Err(err).Str("userID", id).Str("eventid", event.ID).Msg("failed to store event for user")
return
}
}
}

func (cl *ClientlogService) sendSSE(userid string, typ string, data interface{}) error {
func (cl *ClientlogService) sendSSE(userid string, evType string, data interface{}) error {
b, err := json.Marshal(data)
if err != nil {
return err
}

return events.Publish(context.Background(), cl.publisher, events.SendSSE{
UserID: userid,
Type: typ,
Type: evType,
Message: b,
})
}

0 comments on commit 586bae4

Please sign in to comment.