File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -158,3 +158,12 @@ def vacuum(self):
158
158
with self ._connect () as connection :
159
159
cursor = connection .cursor ()
160
160
cursor .execute ("VACUUM;" )
161
+
162
+ # ----------------------------------------------------------------------
163
+ def get_non_flushed_event_count (self ):
164
+ query_fetch = '''SELECT count(*) FROM `event` WHERE `pending_delete` = 0;'''
165
+ with self ._connect () as connection :
166
+ cursor = connection .cursor ()
167
+ cursor .execute (query_fetch )
168
+ count = cursor .fetchone ()[0 ]
169
+ return count
Original file line number Diff line number Diff line change @@ -129,6 +129,8 @@ def _setup_database(self):
129
129
else :
130
130
self ._database = MemoryCache (cache = self ._memory_cache , event_ttl = self ._event_ttl )
131
131
132
+ self ._non_flushed_event_count = self ._database .get_non_flushed_event_count ()
133
+
132
134
# ----------------------------------------------------------------------
133
135
def _fetch_events (self ):
134
136
while True :
You can’t perform that action at this time.
0 commit comments