diff --git a/django_eventstream/storage.py b/django_eventstream/storage.py index b3930d6..4ac902b 100644 --- a/django_eventstream/storage.py +++ b/django_eventstream/storage.py @@ -118,9 +118,12 @@ def append_event(self, channel: str, event_type: str, data: dict): """ with self.redis.pipeline() as pipe: try: - event_id = pipe.incr("event_counter:" + channel) + pipe.incr("event_counter:" + channel) + results = pipe.execute() + event_id = results[0] event_data = json.dumps({"type": event_type, "data": data}) - pipe.setex( + + pipe.setex( "event:" + channel + ":" + str(event_id), EVENT_TIMEOUT * 60, event_data,