@@ -44,6 +44,7 @@ class DebugEvent:
44
44
def __init__ (self , original_input : EventInputEvaluation ):
45
45
self .original_input = original_input
46
46
47
+
47
48
class IndexEvent :
48
49
__slots__ = ['timestamp' , 'context' ]
49
50
@@ -57,7 +58,7 @@ def __init__(self, config: Config):
57
58
self ._context_formatter = EventContextFormatter (config .all_attributes_private , config .private_attributes )
58
59
59
60
def make_output_events (self , events : List [Any ], summary : EventSummary ):
60
- events_out = [ self .make_output_event (e ) for e in events ]
61
+ events_out = [self .make_output_event (e ) for e in events ]
61
62
if not summary .is_empty ():
62
63
events_out .append (self .make_summary_event (summary ))
63
64
return events_out
@@ -163,10 +164,10 @@ def make_output_event(self, e: Any):
163
164
164
165
return None
165
166
166
- """
167
- Transform summarizer data into the format used for the event payload.
168
- """
169
167
def make_summary_event (self , summary : EventSummary ):
168
+ """
169
+ Transform summarizer data into the format used for the event payload.
170
+ """
170
171
flags_out = dict () # type: Dict[str, Any]
171
172
for key , flag_data in summary .flags .items ():
172
173
flag_data_out = {'default' : flag_data .default , 'contextKinds' : list (flag_data .context_kinds )}
@@ -246,7 +247,7 @@ def run(self):
246
247
def _do_send (self , output_events ):
247
248
# noinspection PyBroadException
248
249
try :
249
- json_body = json .dumps (output_events , separators = (',' ,':' ))
250
+ json_body = json .dumps (output_events , separators = (',' , ':' ))
250
251
log .debug ('Sending events payload: ' + json_body )
251
252
payload_id = str (uuid .uuid4 ())
252
253
r = _post_events_with_retry (
@@ -442,8 +443,6 @@ def _get_indexable_context(self, event: EventInput, block: Callable[[Context], N
442
443
443
444
block (context )
444
445
445
-
446
-
447
446
def _should_debug_event (self , event : EventInputEvaluation ):
448
447
if event .flag is None :
449
448
return False
@@ -492,6 +491,11 @@ def _send_and_reset_diagnostics(self):
492
491
def _do_shutdown (self ):
493
492
self ._flush_workers .stop ()
494
493
self ._flush_workers .wait ()
494
+
495
+ if self ._diagnostic_flush_workers :
496
+ self ._diagnostic_flush_workers .stop ()
497
+ self ._diagnostic_flush_workers .wait ()
498
+
495
499
if self ._close_http :
496
500
self ._http .clear ()
497
501
0 commit comments