Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cache topics impl #105

Merged
merged 4 commits into from
Jul 9, 2024
Merged

Feature/cache topics impl #105

merged 4 commits into from
Jul 9, 2024

Conversation

Oluwawunmi
Copy link
Contributor

@Oluwawunmi Oluwawunmi commented Jun 27, 2024

What

  • Track recursion depth and improved logs
  • Cache update impl and update fix

How to review

Check code is ok.

Who can review

Anyone, not me

Copy link
Contributor

@lindenmckenzie lindenmckenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you address the copy paste naming please?

cache/mock.go Outdated
Comment on lines 42 to 47
mockDataTopic.List = NewSubTopicsMap()
mockDataTopic.List.AppendSubtopicID("economy", Subtopic{ID: "6734", Slug: "economy", LocaliseKeyName: "Economy", ReleaseDate: timeHelper("2022-10-10T08:30:00Z"), ParentID: ""})
mockDataTopic.List.AppendSubtopicID("environmentalaccounts", Subtopic{ID: "1834", Slug: "environmentalaccounts", LocaliseKeyName: "Environmental Accounts", ReleaseDate: timeHelper("2022-10-10T08:30:00Z"), ParentID: "6734"})
mockDataTopic.List.AppendSubtopicID("governmentpublicsectorandtaxes", Subtopic{ID: "8268", Slug: "governmentpublicsectorandtaxes", LocaliseKeyName: "Government Public Sector and Taxes", ReleaseDate: timeHelper("2022-10-10T08:30:00Z"), ParentID: "6734"})
mockDataTopic.List.AppendSubtopicID("publicsectorfinance", Subtopic{ID: "3687", Slug: "publicsectorfinance", LocaliseKeyName: "Public Sector Finance", ReleaseDate: timeHelper("2022-10-10T08:30:00Z"), ParentID: "8268"})
mockDataTopic.List.AppendSubtopicID("internationalmigration", Subtopic{ID: "1234", Slug: "internationalmigration", LocaliseKeyName: "International Migration", ReleaseDate: timeHelper("2022-10-10T08:30:00Z")})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we've talked about the lack of need for the concept of 'DataTopic' here before.

})
})
})

Convey("Given root topics exist but no topics found", t, func() {
Convey("Given root topics exist but no data topics found", t, func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Convey("Given root topics exist but no data topics found", t, func() {
Convey("Given root topics exist but no topics found", t, func() {

cache/topic.go Outdated
}

func (tc *TopicCache) GetTopic(ctx context.Context, slug string) (*Subtopic, error) {
dataTopicCache, err := tc.GetData(ctx, TopicCacheKey)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dataTopicCache, err := tc.GetData(ctx, TopicCacheKey)
topicCache, err := tc.GetData(ctx, TopicCacheKey)

cache/topic.go Outdated
}
log.Error(ctx, "failed to get the data topic cache", err, logData)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.Error(ctx, "failed to get the data topic cache", err, logData)
log.Error(ctx, "failed to get the topic cache", err, logData)

@Oluwawunmi Oluwawunmi merged commit 6023e8f into develop Jul 9, 2024
5 checks passed
@Oluwawunmi Oluwawunmi deleted the feature/cache-topics-impl branch July 9, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants