Skip to content

Commit

Permalink
Add fallback 0 size for no files in storage server usage
Browse files Browse the repository at this point in the history
  • Loading branch information
harminius committed Dec 13, 2024
1 parent c509977 commit d3598a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/mergin/sync/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def files_size():
LEFT OUTER JOIN file_history fh ON fh.id = lf.file_id
WHERE fh.change = 'update_diff'::push_change_type
)
SELECT pg_size_pretty(SUM(sum)) FROM partials;
SELECT pg_size_pretty(COALESCE(SUM(sum), 0)) FROM partials;
"""
)
return db.session.execute(files_size).scalar() or "0 bytes"
return db.session.execute(files_size).scalar()

0 comments on commit d3598a3

Please sign in to comment.