Skip to content

Commit

Permalink
sweep: DIRACGrid#7964 Avoid locking in MessageQueueHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr authored and web-flow committed Dec 20, 2024
1 parent ddf4621 commit cb318a5
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,15 @@ def emit(self, record):
strRecord = self.format(record)
if self.producer is not None:
self.producer.put(json.loads(strRecord))

def handle(self, record):
"""
Conditionally emit the specified logging record.
Override the handle method from logging.Handler as there is no need to
acquire the lock to emit the record.
"""
rv = self.filter(record)
if rv:
self.emit(record)
return rv

0 comments on commit cb318a5

Please sign in to comment.