Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
chacha912 committed Feb 15, 2023
1 parent 7c133c4 commit faafccc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion server/backend/sync/memory/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (m *PubSub) Subscribe(
m.subscriptionsMapMu.Lock()
defer m.subscriptionsMapMu.Unlock()

sub := sync.NewSubscription(subscriber, keys)
sub := sync.NewSubscription(subscriber)
m.subscriptionMapBySubscriber[sub.SubscriberID()] = sub

for _, docKey := range keys {
Expand Down
10 changes: 1 addition & 9 deletions server/backend/sync/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@ import (
type Subscription struct {
id string
subscriber types.Client
docKeys []key.Key
closed bool
events chan DocEvent
}

// NewSubscription creates a new instance of Subscription.
func NewSubscription(subscriber types.Client, keys []key.Key) *Subscription {
func NewSubscription(subscriber types.Client) *Subscription {
return &Subscription{
id: xid.New().String(),
subscriber: subscriber,
docKeys: keys,
events: make(chan DocEvent, 1),
}
}
Expand All @@ -59,12 +57,6 @@ func (s *Subscription) Events() chan DocEvent {
return s.events
}

// DocKeys returns an array of the keys of the documents
// that the subscription is subscribed to.
func (s *Subscription) DocKeys() []key.Key {
return s.docKeys
}

// Subscriber returns the subscriber of this subscription.
func (s *Subscription) Subscriber() types.Client {
return s.subscriber
Expand Down

0 comments on commit faafccc

Please sign in to comment.