gitlab-client-cache 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gitlab/client/cache/caching.rb +7 -0
- data/lib/gitlab/client/cache/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b0e82dfc66ede983af9394fcd775e1fd5b1bd2449c3142b2424e321ca912ba9
|
4
|
+
data.tar.gz: 56091a27ca44807c8ccfcc5ac5452c324bb0990e95a32d1585a7b5f5853c9117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 418150f965dcabfaa90855fca348f5399ab0fa15d014e26493eacefe5199e9265104edf43eab99fd7cf948333562e4c39646b0f948545523bc3125eb0f1d6bea
|
7
|
+
data.tar.gz: fcebb8176e19624554ea146860634d24a190817e5be70acd27e3a04218c8b43cee981e5b6744dd9bced5d8651858be0272688b22b9afb2d898d571ab0598ed78
|
@@ -69,6 +69,13 @@ class Gitlab::Client::Cache::Caching
|
|
69
69
|
return if result == :skip_caching
|
70
70
|
|
71
71
|
path.dirname.mkpath
|
72
|
+
|
73
|
+
content = deflate(Marshal.dump(result))
|
74
|
+
# Write atomatically
|
75
|
+
temp = path.sub_ext(".#{rand(2 << 32)}")
|
76
|
+
temp.write(content)
|
77
|
+
temp.rename(path)
|
78
|
+
|
72
79
|
path.write(deflate(Marshal.dump(value)))
|
73
80
|
end
|
74
81
|
|