"git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "a16e570ddb6e976a78fc1234a0697019fd836ed1"
Commit d0e594f9 authored by Dima's avatar Dima
Browse files

Releasing file lock

parent 629b22ad
...@@ -388,13 +388,13 @@ def get_from_cache( ...@@ -388,13 +388,13 @@ def get_from_cache(
# we are copying the file before closing it, so flush to avoid truncation # we are copying the file before closing it, so flush to avoid truncation
temp_file.flush() temp_file.flush()
logger.info("storing %s in cache at %s", url, cache_path) logger.info("storing %s in cache at %s", url, cache_path)
os.rename(temp_file.name, cache_path) os.rename(temp_file.name, cache_path)
logger.info("creating metadata file for %s", cache_path) logger.info("creating metadata file for %s", cache_path)
meta = {"url": url, "etag": etag} meta = {"url": url, "etag": etag}
meta_path = cache_path + ".json" meta_path = cache_path + ".json"
with open(meta_path, "w") as meta_file: with open(meta_path, "w") as meta_file:
json.dump(meta, meta_file) json.dump(meta, meta_file)
return cache_path return cache_path
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment