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

feat(worker/mastodon): apply Postgres DB for mastodon handle storage and modify query functions #578

Merged
merged 13 commits into from
Oct 16, 2024

Conversation

FrankLi123
Copy link
Contributor

@FrankLi123 FrankLi123 commented Oct 15, 2024

Summary

This PR includes the following changes:

  • Migrated Mastodon handle data storage from Redis to Postgres DB.
  • Add simple batch-insert feature
  • Implemented new query functions for federated API handlers.
  • Enabled pagination using limit and cursor parameters for federated API requests.
  • Fixed new file structure to ensure consistency

Checklist

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@FrankLi123 FrankLi123 marked this pull request as draft October 15, 2024 09:03
@FrankLi123 FrankLi123 changed the title feat(worker/mastodon): feat(worker/mastodon): apply Postgres DB for mastodon handle storage and modify query functions Oct 15, 2024
@FrankLi123
Copy link
Contributor Author

FrankLi123 commented Oct 15, 2024

Endpoint

GET /federated/handles

Retrieve a paginated list of updated Mastodon handles based on a timestamp (since) with optional pagination.

Request Parameters

  1. since

    • Example: since=1728999503
  2. cursor (optional)

  3. limit (optional, default: 100)

    • Number of handles to return.
    • Example: limit=10

Request Example

Make request with since:

curl --location 'http://localhost/federated/handles?cursor=%40noellabo%40fedibird.com&limit=10' \
--header 'Authorization: Bearer test'

@FrankLi123 FrankLi123 self-assigned this Oct 15, 2024
@FrankLi123 FrankLi123 marked this pull request as ready for review October 15, 2024 09:07
@FrankLi123 FrankLi123 marked this pull request as draft October 15, 2024 10:02
@FrankLi123 FrankLi123 marked this pull request as ready for review October 15, 2024 15:02
@RSS3-Network RSS3-Network deleted a comment from FrankLi123 Oct 15, 2024
@brucexc brucexc requested review from iavl and removed request for HenryQW October 16, 2024 00:16
@brucexc brucexc merged commit 47c389c into worker-dev Oct 16, 2024
5 checks passed
@brucexc brucexc deleted the feat/modify-mastodon-handles-storage branch October 16, 2024 00:24
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.

3 participants