Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wujiasheng03 committed Apr 8, 2024
1 parent 22c6542 commit 2e80c92
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions lyrebird/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,19 @@ def broadcast_handler(self, callback_fn, event, args, kwargs):
finally:
event_end_time = time.time()
event_duration = (event_end_time - event_start_time) * 1000
trace_info = {
'channel': event.channel,
'callback_fn': callback_fn.__name__,
'callback_args': str(callback_args),
'callback_kwargs': str(callback_kwargs)
}
self.publish('lyrebird_metrics', {
'sender': 'EventServer',
'action': 'broadcast_handler',
'duration': event_duration,
'trace_info': str(trace_info)
})
if event.channel != 'lyrebird_metrics':
trace_info = {
'channel': event.channel,
'callback_fn': callback_fn.__name__,
'callback_args': str(callback_args),
'callback_kwargs': str(callback_kwargs)
}
self.publish('lyrebird_metrics', {
'sender': 'EventServer',
'action': 'broadcast_handler',
'duration': event_duration,
'trace_info': str(trace_info)
})

def run(self):
while self.running:
Expand Down

0 comments on commit 2e80c92

Please sign in to comment.