Skip to content

Conversation

@eminence
Copy link
Member

  • When reading the cache, catch some errors on load, instead of crashing
  • When writing to cache, write to tmp file, then move it into place.
    This should be more robust if a ctrl+c is recieved while writing the
    cache

Addresses #1266

cc @ion1 @agrif

I'll merge this in a few days, so let me know if you have any comments

* When reading the cache, catch some errors on load, instead of crashing
* When writing to cache, write to tmp file, then move it into place.
  This should be more robust if a ctrl+c is recieved while writing the
  cache

Addresses #1266
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we use stuff from files.py in here in case rename doesn't work?

Copy link
Member

Choose a reason for hiding this comment

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

I concur! There's a whole thing for this IIRC.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this the library you are referring too? How do you all feel about adding a new 3rd party dependency?

https://pythonhosted.org/files/

Copy link
Member

Choose a reason for hiding this comment

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

no, I'm talking about files.py in overviewer_core... which, uh... I think you wrote.

Copy link
Member Author

Choose a reason for hiding this comment

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

hey neat! i forgot about that! ok yeah, we should use that

@agrif
Copy link
Member

agrif commented Dec 31, 2015

About saving the corrupted uuid cache: do we ever actually expect somebody to ungzip the file and fix it? Or fix it so it's un-gzippable? Why not just delete the cache?

@eminence
Copy link
Member Author

eminence commented Jan 1, 2016

Someone from IRC convinced me that silently deleting files wasn't a good idea. It was a weak argument, and the only plausible explanation I saw was: someone accidentally copied important data into the UUID cache.

eminence added a commit that referenced this pull request Jan 14, 2016
@eminence eminence merged commit d849f25 into master Jan 14, 2016
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.

4 participants