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

Adds the option to fetch metadata to imports #979

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

daniel-endraws
Copy link

I had the same request as #952, so I implemented it in case anyone else does too!

Quickly testing with 177 imported bookmarks (all with missing fields) took ~20 seconds (85 seconds without the threading).

Copy link
Owner

@sissbruecker sissbruecker left a comment

Choose a reason for hiding this comment

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

Thanks, this is a good start. Added some comments below.

bookmarks_to_create + bookmarks_to_update,
)

with ThreadPoolExecutor(5) as executor:
Copy link
Owner

Choose a reason for hiding this comment

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

This should be a background task instead, you can check bookmarks/services/tasks.py as a reference for existing ones. So you could add a new task there, then schedule one per bookmark from here.

Tests would be welcome as well, test_bookmarks_tasks.py is used for testing tasks themselves, and test_importer.py could test that the task is called on import.

Copy link
Owner

Choose a reason for hiding this comment

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

This can be reverted when adding the background task.

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