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: locked link #35976

Merged
merged 5 commits into from
Dec 15, 2024
Merged

feat: locked link #35976

merged 5 commits into from
Dec 15, 2024

Conversation

rayzhou-bit
Copy link
Contributor

The celery task on will now check if a link is locked when scanning the course.

validated_url_list = asyncio.run(validate_urls_access_in_batches(url_list, course_key, batch_size=100))
broken_or_locked_urls, retry_list = filter_by_status(validated_url_list)

# Retry urls that failed due to connection error
Copy link
Member

Choose a reason for hiding this comment

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

nit: Generally it's really nice that you decoupled everything into functions. Everything is extremely well readable until here, where it is still good but a bit less clear structured. A small improvement could be to put the two chunks of code that are following into functions also. The for loop is a nice thing to put into a named function so people can see what it does without needing to read the code, and in the try/except statement, everything inside of try can be a function that's called with one line in the try. That's a pattern you often see where any try/except statement will have the try block just be one function call and the except block stay as it's here. What do you think?

The code already looks really good so this is a pretty minor thing. If you prefer it like this that's okay as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense to do! I'll make that change

Copy link
Member

@jesperhodge jesperhodge left a comment

Choose a reason for hiding this comment

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

I think I found a bug

cms/djangoapps/contentstore/tasks.py Show resolved Hide resolved
@rayzhou-bit rayzhou-bit merged commit 3f82c62 into 2u/course-optimizer Dec 15, 2024
27 of 50 checks passed
@rayzhou-bit rayzhou-bit deleted the 2u/optimizer-locked-link branch December 15, 2024 01:43
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