Don't read upgrade progress file if size hasn't changed
apparently that is possible sometimes? or perhaps just an issue on python 3?
This commit is contained in:
parent
4c2f1aa4ed
commit
6febd01e76
|
@ -343,12 +343,13 @@ class UpgradeView(MasterView):
|
|||
offset = session.get('stdout.offset', 0)
|
||||
if os.path.exists(path):
|
||||
size = os.path.getsize(path) - offset
|
||||
with open(path, 'rb') as f:
|
||||
f.seek(offset)
|
||||
chunk = f.read(size)
|
||||
data['stdout'] = chunk.decode('utf8').replace('\n', '<br />')
|
||||
session['stdout.offset'] = offset + size
|
||||
session.save()
|
||||
if size:
|
||||
with open(path, 'rb') as f:
|
||||
f.seek(offset)
|
||||
chunk = f.read(size)
|
||||
data['stdout'] = chunk.decode('utf8').replace('\n', '<br />')
|
||||
session['stdout.offset'] = offset + size
|
||||
session.save()
|
||||
|
||||
return data
|
||||
|
||||
|
|
Loading…
Reference in a new issue