Skip to content

Commit

Permalink
Revert redis/subscriptions.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Kolkov committed Mar 5, 2021
1 parent 971f890 commit f9ccd7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions database/redis/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (connector *DbConnector) updateSubscription(newSubscription *moira.Subscrip
c := connector.pool.Get()
defer c.Close()

c.Send("MULTI") //nolint
c.Send("MULTI") //nolint
addSendSubscriptionRequest(c, *newSubscription, oldSubscription) //nolint
_, err := c.Do("EXEC")
if err != nil {
Expand Down Expand Up @@ -156,13 +156,13 @@ func (connector *DbConnector) removeSubscription(subscription *moira.Subscriptio
c := connector.pool.Get()
defer c.Close()

c.Send("MULTI") //nolint
c.Send("MULTI") //nolint
c.Send("SREM", userSubscriptionsKey(subscription.User), subscription.ID) //nolint
for _, tag := range subscription.Tags {
c.Send("SREM", tagSubscriptionKey(tag), subscription.ID) //nolint
}
c.Send("SREM", anyTagsSubscriptionsKey, subscription.ID) //nolint
c.Send("DEL", subscriptionKey(subscription.ID)) //nolint
c.Send("DEL", subscriptionKey(subscription.ID)) //nolint
if _, err := c.Do("EXEC"); err != nil {
return fmt.Errorf("failed to EXEC: %s", err.Error())
}
Expand Down Expand Up @@ -243,7 +243,7 @@ func addSendSubscriptionRequest(c redis.Conn, subscription moira.SubscriptionDat
}

c.Send("SADD", userSubscriptionsKey(subscription.User), subscription.ID) //nolint
c.Send("SET", subscriptionKey(subscription.ID), bytes) //nolint
c.Send("SET", subscriptionKey(subscription.ID), bytes) //nolint
return nil
}

Expand Down

0 comments on commit f9ccd7e

Please sign in to comment.