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

Stop/resume fetching process #12

Open
ghost opened this issue Sep 22, 2019 · 3 comments
Open

Stop/resume fetching process #12

ghost opened this issue Sep 22, 2019 · 3 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Sep 22, 2019

Is it safe to stop and then resume the fetching process with ctrl+c?
Can that lead to data corruption or inconsistency?
Does fetch_links.py properly save data before exiting?

@libertysoft3
Copy link
Owner

Yes, it is safe to quit and re-start, although it is not well tested. I would personally wait until the script outputs "got %s links, wrote %s and %s comments", which happens every 10 links/posts. Waiting for this will avoid quitting the script while write_links() is running.

Since data is written every 10 links/posts, by quitting the most data you will lose is 10 links.

@libertysoft3
Copy link
Owner

If you know how to improve this I'm all ears. I suck at python.

@libertysoft3
Copy link
Owner

libertysoft3 commented Sep 26, 2019

Looking at this in more detail, it is safe to re-run a data fetch, but it's not smart at all. It will re-download all of the data and just refuse to write it to disk since it's already there. (edit: it will skip fetching comments if the link is already written to file)

So for now, for sanity/efficiency, you have to check to see the last date that you downloaded data for, and start your next run on that same date.

I think a 'resume' flag could be added that will skip ahead to by date based on what's already on disk. Maybe we can improve on ctrl+c as well. We can leave this one open.

@libertysoft3 libertysoft3 added enhancement New feature or request bug Something isn't working labels Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant