mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-11-07 11:41:00 +01:00
Try/catch to skip invalid JSON in dirtyDB
This commit is contained in:
parent
0443de4dc9
commit
5f836f6211
@ -31,8 +31,11 @@ with open(dirtydb_input, 'r') as fd:
|
|||||||
print 'Reading %s' % dirtydb_input
|
print 'Reading %s' % dirtydb_input
|
||||||
for line in fd:
|
for line in fd:
|
||||||
lines += 1
|
lines += 1
|
||||||
data = json.loads(line)
|
try:
|
||||||
dirtydb[data['key']] = line
|
data = json.loads(line)
|
||||||
|
dirtydb[data['key']] = line
|
||||||
|
except:
|
||||||
|
print("Skipping invalid JSON!")
|
||||||
if lines % 10000 == 0:
|
if lines % 10000 == 0:
|
||||||
sys.stderr.write('.')
|
sys.stderr.write('.')
|
||||||
print
|
print
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user