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