mirror of
https://mau.dev/maunium/synapse.git
synced 2024-08-27 20:52:30 +00:00
Merge pull request #2530 from matrix-org/rav/fix_receipt_logcontext
fix a logcontext leak in read receipt handling
This commit is contained in:
commit
68fd82e840
@ -12,6 +12,7 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
from synapse.util import logcontext
|
||||||
|
|
||||||
from ._base import BaseHandler
|
from ._base import BaseHandler
|
||||||
|
|
||||||
@ -59,6 +60,8 @@ class ReceiptsHandler(BaseHandler):
|
|||||||
is_new = yield self._handle_new_receipts([receipt])
|
is_new = yield self._handle_new_receipts([receipt])
|
||||||
|
|
||||||
if is_new:
|
if is_new:
|
||||||
|
# fire off a process in the background to send the receipt to
|
||||||
|
# remote servers
|
||||||
self._push_remotes([receipt])
|
self._push_remotes([receipt])
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
@ -126,6 +129,7 @@ class ReceiptsHandler(BaseHandler):
|
|||||||
|
|
||||||
defer.returnValue(True)
|
defer.returnValue(True)
|
||||||
|
|
||||||
|
@logcontext.preserve_fn # caller should not yield on this
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _push_remotes(self, receipts):
|
def _push_remotes(self, receipts):
|
||||||
"""Given a list of receipts, works out which remote servers should be
|
"""Given a list of receipts, works out which remote servers should be
|
||||||
|
Loading…
Reference in New Issue
Block a user