Skip to content

Commit

Permalink
🐛 distinct eng urls name
Browse files Browse the repository at this point in the history
  • Loading branch information
perebaj committed Jan 19, 2024
1 parent 9742688 commit 13d1396
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/newsletter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func main() {
defer close(URLCh)
for range time.Tick(cfg.LoopDurationMinutes) {
slog.Info("fetching engineers")
gotURLs, err := storage.DistinctEngineerURL(ctx)
gotURLs, err := storage.DistinctEngineerURLs(ctx)
if err != nil {
slog.Error("error getting engineers", "error", err)
signalCh <- syscall.SIGTERM
Expand Down
4 changes: 2 additions & 2 deletions mongodb/newsletter.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func (m *NLStorage) SaveEngineer(ctx context.Context, e Engineer) error {
return nil
}

// DistinctEngineerURL returns all url sites of each distinct engineer
func (m *NLStorage) DistinctEngineerURL(ctx context.Context) ([]interface{}, error) {
// DistinctEngineerURLs returns all url sites of each distinct engineer
func (m *NLStorage) DistinctEngineerURLs(ctx context.Context) ([]interface{}, error) {
database := m.client.Database(m.DBName)
collection := database.Collection("engineers")

Expand Down
4 changes: 2 additions & 2 deletions mongodb/newsletter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func TestNLStorageSaveEngineer(t *testing.T) {
t.Cleanup(teardown(ctx, client, DBName))
}

func TestNLSEngineersURL(t *testing.T) {
func TestNLStorageDistinctEngineerURLs(t *testing.T) {
ctx := context.Background()
client, DBName := setup(ctx, t)

Expand Down Expand Up @@ -249,7 +249,7 @@ func TestNLSEngineersURL(t *testing.T) {
t.Fatal("error saving 3 engineer", err)
}

got, err := NLStorage.DistinctEngineerURL(ctx)
got, err := NLStorage.DistinctEngineerURLs(ctx)
if err != nil {
t.Fatal("error getting engineers", err)
}
Expand Down

0 comments on commit 13d1396

Please sign in to comment.