mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-14 11:57:44 +00:00
Close the file before trying to read file size
This commit is contained in:
parent
5d71a6c9b9
commit
5e15d598ce
1 changed files with 5 additions and 0 deletions
|
@ -1049,6 +1049,11 @@ class MediaRepository:
|
||||||
finally:
|
finally:
|
||||||
t_byte_source.close()
|
t_byte_source.close()
|
||||||
|
|
||||||
|
# We flush and close the file to ensure that the bytes have
|
||||||
|
# been written before getting the size.
|
||||||
|
f.flush()
|
||||||
|
f.close()
|
||||||
|
|
||||||
t_len = os.path.getsize(fname)
|
t_len = os.path.getsize(fname)
|
||||||
|
|
||||||
# Write to database
|
# Write to database
|
||||||
|
|
Loading…
Reference in a new issue