##// END OF EJS Templates
diff-cache: use bz2 to reduce diff-cache size.
marcink -
r2690:01439ec4 default
parent child Browse files
Show More
@@ -25,11 +25,12 b' Set of diffing helpers, previously part '
25 25
26 26 import os
27 27 import re
28 import bz2
29
28 30 import collections
29 31 import difflib
30 32 import logging
31 33 import cPickle as pickle
32
33 34 from itertools import tee, imap
34 35
35 36 from rhodecode.lib.vcs.exceptions import VCSError
@@ -1142,7 +1143,7 b' def cache_diff(cached_diff_file, diff, c'
1142 1143 }
1143 1144
1144 1145 try:
1145 with open(cached_diff_file, 'wb') as f:
1146 with bz2.BZ2File(cached_diff_file, 'wb') as f:
1146 1147 pickle.dump(struct, f)
1147 1148 log.debug('Saved diff cache under %s', cached_diff_file)
1148 1149 except Exception:
@@ -1168,7 +1169,7 b' def load_cached_diff(cached_diff_file):'
1168 1169
1169 1170 data = None
1170 1171 try:
1171 with open(cached_diff_file, 'rb') as f:
1172 with bz2.BZ2File(cached_diff_file, 'rb') as f:
1172 1173 data = pickle.load(f)
1173 1174 log.debug('Loaded diff cache from %s', cached_diff_file)
1174 1175 except Exception:
General Comments 0
You need to be logged in to leave comments. Login now