Merge pull request #5104 from reitermarkus/create-cache

Ensure cache directory for `CacheStoreDatabase` exists.
This commit is contained in:
Markus Reiter 2018-10-16 23:54:46 +02:00 committed by GitHub
commit 178db5dca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,7 @@ class CacheStoreDatabase
# Closes the underlying database (if it is created and open). # Closes the underlying database (if it is created and open).
def close_if_open! def close_if_open!
return unless @db return unless @db
cache_path.dirname.mkpath
cache_path.atomic_write(JSON.dump(@db)) cache_path.atomic_write(JSON.dump(@db))
end end