Skip to content

Commit

Permalink
Merge pull request #57 from planetary-social/follow_puller_fix
Browse files Browse the repository at this point in the history
Correctly initialize follows puller
  • Loading branch information
dcadenas committed Aug 21, 2024
2 parents fa3d8fd + 3113bc4 commit 2a524d7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ test:

.PHONY: recreate-emulator
recreate-emulator:
sudo docker-compose -f ./docker-compose-integration.yml rm -f -s -v
sudo docker-compose -f ./docker-compose-integration.yml up -d
docker compose -f ./docker-compose-integration.yml rm -f -s -v
docker compose -f ./docker-compose-integration.yml up -d

.PHONY: test-integration
test-integration:
Expand Down
5 changes: 1 addition & 4 deletions cmd/notification-service/di/inject_pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ var pubsubSet = wire.NewSet(
pubsub.NewReceivedEventPubSub,
wire.Bind(new(app.ReceivedEventPublisher), new(*pubsub.ReceivedEventPubSub)),
wire.Bind(new(app.ReceivedEventSubscriber), new(*pubsub.ReceivedEventPubSub)),
)

var googlePubsubSet = wire.NewSet(
newExternalEventPublisher,
newExternalFollowChangeSubscriber,
newExternalEventPublisher,
)

func newExternalEventPublisher(config config.Config, logger watermill.LoggerAdapter) (app.ExternalEventPublisher, error) {
Expand Down
7 changes: 0 additions & 7 deletions cmd/notification-service/di/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/ThreeDotsLabs/watermill"
"github.com/google/wire"
"github.com/planetary-social/go-notification-service/service/adapters/apns"
"github.com/planetary-social/go-notification-service/service/adapters/mocks"
"github.com/planetary-social/go-notification-service/service/app"
"github.com/planetary-social/go-notification-service/service/config"
"github.com/planetary-social/go-notification-service/service/domain/notifications"
Expand All @@ -26,7 +25,6 @@ func BuildService(context.Context, config.Config) (Service, func(), error) {
downloaderSet,
generatorSet,
pubsubSet,
googlePubsubSet,
loggingSet,
adaptersSet,
followChangePullerSet,
Expand Down Expand Up @@ -55,11 +53,6 @@ func BuildIntegrationService(context.Context, config.Config) (IntegrationService
pubsubSet,
loggingSet,
integrationAdaptersSet,

mocks.NewMockExternalEventPublisher,
mocks.NewMockExternalFollowChangeSubscriber,
wire.Bind(new(app.ExternalEventPublisher), new(*mocks.MockExternalEventPublisher)),
wire.Bind(new(app.ExternalFollowChangeSubscriber), new(*mocks.MockExternalFollowChangeSubscriber)),
)
return IntegrationService{}, nil, nil
}
Expand Down
19 changes: 13 additions & 6 deletions cmd/notification-service/di/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion docker-compose-integration.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.2"
services:
firestore_emulator:
image: mtlynch/firestore-emulator
Expand Down
7 changes: 4 additions & 3 deletions service/app/follow_change_puller.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ func NewFollowChangePuller(
metrics Metrics,
) *FollowChangePuller {
return &FollowChangePuller{
logger: logger.New("followChangePuller"),
metrics: metrics,
counter: 0,
externalFollowChangeSubscriber: externalFollowChangeSubscriber,
logger: logger.New("followChangePuller"),
metrics: metrics,
counter: 0,
}
}

Expand Down

0 comments on commit 2a524d7

Please sign in to comment.