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

Refresh User Profile on Demand #28

Open
ishan-xy opened this issue Oct 14, 2024 · 0 comments
Open

Refresh User Profile on Demand #28

ishan-xy opened this issue Oct 14, 2024 · 0 comments
Labels
enhancement New feature or request On Priority Extra attention is needed

Comments

@ishan-xy
Copy link
Collaborator

Refresh User Data on Demand

Description

Updates to a user's Codeboard profile may take a few minutes to reflect recent activity on LeetCode. To provide a more responsive experience, we need an API endpoint that allows users to manually refresh their profile data on demand.

Suggested Fix:

Create this API endpoint in the leaderboard app and ensure that:

  • The user is authenticated before proceeding.
  • Retrieve the user's username and ID from the Database [Leetcode Model].
  • The user's username and ID are retrieved and passed to get_and_update_user_data() (a Celery task in tasks.py) to fetch and update the data.
  • Prefer running it as a Celery task, though this might impact existing concurrency settings—so check if running the function directly would be a better fit for your setup.

Refer to the Profile(APIView) class in leaderboard/views.py for a similar logic of getting the user instance.

Additional Notes:

  • Running the task asynchronously is ideal, but it may require adjustments based on how it interacts with current concurrency limits.
  • Log the errors properly.
@ishan-xy ishan-xy added enhancement New feature or request On Priority Extra attention is needed labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request On Priority Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant