diff --git a/src/django_clickhouse/database.py b/src/django_clickhouse/database.py index 69f9de3..aa0e8b2 100644 --- a/src/django_clickhouse/database.py +++ b/src/django_clickhouse/database.py @@ -116,8 +116,10 @@ class Database(InfiDatabase): statsd.incr(statsd_key, lines) yield buf.getvalue() - with statsd.timer(statsd_key): - self._send(next(gen())) + # For testing purposes + for data in gen(): + with statsd.timer(statsd_key): + self._send(data) class ConnectionProxy: