Skip to content

Commit

Permalink
Merge pull request #104 from MattExact/postgres-disk-full
Browse files Browse the repository at this point in the history
Avoid a disk full condition for Postgres servers
  • Loading branch information
long2ice authored May 20, 2024
2 parents aebac61 + ab0a0c5 commit f837e60
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions meilisync/source/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ def _consumer(self, msg: ReplicationMessage):
)
)

# Report success to the server to avoid a “disk full” condition.
# https://www.psycopg.org/docs/extras.html#psycopg2.extras.ReplicationCursor.consume_stream
msg.cursor.send_feedback(flush_lsn=msg.data_start)

async def get_count(self, sync: Sync):
with self.conn_dict.cursor() as cur:
cur.execute(f"SELECT COUNT(*) FROM {sync.table}")
Expand Down

0 comments on commit f837e60

Please sign in to comment.