Skip to content

Commit

Permalink
kruto
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed Jun 10, 2024
1 parent 6a57d91 commit e78efe9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/api-gql/internal/gql/resolvers/overlays.resolver.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,11 @@ func (r *subscriptionResolver) nowPlayingOverlaySettingsSubscription(
apiKey string,
) (<-chan *gqlmodel.NowPlayingOverlay, error) {
user := model.Users{}
if err := r.gorm.Where(`"apiKey" = ?`, apiKey).First(&user).Error; err != nil {
if err := r.gorm.
WithContext(ctx).
Where(`"apiKey" = ?`, apiKey).
First(&user).
Error; err != nil {
return nil, fmt.Errorf("failed to get user: %w", err)
}

Expand Down Expand Up @@ -557,7 +561,11 @@ func (r *subscriptionResolver) nowPlayingCurrentTrackSubscription(
apiKey string,
) (<-chan *gqlmodel.NowPlayingOverlayTrack, error) {
user := model.Users{}
if err := r.gorm.Where(`"apiKey" = ?`, apiKey).First(&user).Error; err != nil {
if err := r.gorm.
WithContext(ctx).
Where(`"apiKey" = ?`, apiKey).
First(&user).
Error; err != nil {
return nil, fmt.Errorf("failed to get user: %w", err)
}

Expand Down

0 comments on commit e78efe9

Please sign in to comment.