-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat: locked link #35976
Conversation
cms/djangoapps/contentstore/tasks.py
Outdated
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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
The celery task on will now check if a link is locked when scanning the course.