Created
December 30, 2023 21:39
-
-
Save irsl/3c6c153aea096abd6f44aa2f8678572b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load(cache_file) | |
marshal = File.open(cache_file, "rb") { |f| Zlib::Inflate.inflate(f.read) } | |
Marshal.load(marshal) | |
rescue SystemCallError, ::Zlib::DataError, ::Zlib::BufError, TypeError | |
nil | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment