File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import logging
8
8
9
- PAGING = 10000
9
+ PAGING = 1000
10
10
11
11
12
12
class Backup :
@@ -18,7 +18,6 @@ def create_from(self, chunk):
18
18
backup_map = {}
19
19
start = chunk * PAGING
20
20
end = start + PAGING
21
-
22
21
for i in range (start , end ):
23
22
try :
24
23
current = self .journal [i ]
@@ -31,7 +30,7 @@ def create_from(self, chunk):
31
30
if i % 100 == 0 :
32
31
logging .info (str (i ) + ":" + b2x (self .journal [i ]))
33
32
34
- logging .info ("map len " + str (len (backup_map )) + " start:" + str (start ) + " finish :" + str (finish ))
33
+ logging .info ("map len " + str (len (backup_map )) + " start:" + str (start ) + " end :" + str (end ))
35
34
kv_bytes = self .__kv_map_to_bytes (backup_map )
36
35
37
36
return kv_bytes
Original file line number Diff line number Diff line change @@ -73,13 +73,15 @@ def get_backup(self):
73
73
except :
74
74
self .send_response (404 )
75
75
self .send_header ('Content-type' , 'text/plain' )
76
+ self .end_headers ()
76
77
return
77
78
78
79
result = self .backup .create_from (chunk )
79
80
80
81
if result is None :
81
82
self .send_response (404 )
82
83
self .send_header ('Content-type' , 'text/plain' )
84
+ self .end_headers ()
83
85
return
84
86
85
87
self .send_response (200 )
@@ -220,7 +222,7 @@ def do_GET(self):
220
222
self .get_timestamp ()
221
223
elif self .path == '/tip' :
222
224
self .get_tip ()
223
- elif self .path .startswith == '/experimental/backup/' :
225
+ elif self .path .startswith ( '/experimental/backup/' ) :
224
226
self .get_backup ()
225
227
else :
226
228
self .send_response (404 )
You can’t perform that action at this time.
0 commit comments