Set timeout to 0 when receiving PostgreSQL notifications
There is no need to wait 2 seconds for more notifications as we call get_notifications only when the selector is triggered. Closes #15102 (grafted from 02567102eb63f69faedf61ae83c51a5075b57588) --HG-- branch : 8.0
This commit is contained in:
@@ -480,7 +480,7 @@ class Database(DatabaseInterface):
|
||||
cursor.execute('SELECT pg_notify(%s, %s)', (channel, payload))
|
||||
|
||||
def get_notifications(self, connection):
|
||||
return list(connection.notifies(timeout=2))
|
||||
return list(connection.notifies(timeout=0))
|
||||
|
||||
def lock(self, connection, table):
|
||||
cursor = connection.cursor()
|
||||
|
||||
Reference in New Issue
Block a user