def send_event(event: Event) -> None: event_type = get_event_type(event) event_message = EventMessage( event_type=event_type, event=event.copy(deep=True), instance_id=get_instance_id(), instance_name=get_instance_name(), ) # work around odd bug with Event Message creation. See PR 939 if event_message.event != event: event_message.event = event.copy(deep=True) log_event(event, event_type) queue_signalr_event(event_message) Webhook.send_event(event_message)
def ping(self) -> EventPing: ping = EventPing(ping_id=uuid4()) self._add_event( EventMessage( event_type=EventType.ping, event=ping, instance_id=get_instance_id(), instance_name=get_instance_name(), )) return ping
def send_event(event: Event) -> None: event_type = get_event_type(event) log_event(event, event_type) event_message = EventMessage( event_type=event_type, event=event, instance_id=get_instance_id(), instance_name=get_instance_name(), ) EVENTS.put(event_message) Webhook.send_event(event_message)
def send_event(event: Event) -> None: event_type = get_event_type(event) logging.info("sending event: %s - %s", event_type, event) event_message = EventMessage( event_type=event_type, event=event, instance_id=get_instance_id(), instance_name=get_instance_name(), ) EVENTS.put(event_message) Webhook.send_event(event_message)
def ping(self) -> EventPing: ping = EventPing(ping_id=uuid4()) self._add_event(EventMessage(event_type=EventType.ping, event=ping)) return ping
def send_event(event: Event) -> None: event_type = get_event_type(event) logging.info("sending event: %s - %s", event_type, event) event_message = EventMessage(event_type=event_type, event=event) EVENTS.put(event_message) Webhook.send_event(event_message)
def handler(self, message: Any) -> None: for event_raw in message: message = EventMessage.parse_obj(event_raw) self.cache.add_message(message)