File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
bottlecap/src/logs/lambda Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -235,6 +235,9 @@ impl LambdaProcessor {
235235 LambdaProcessor :: apply_rules ( & self . rules , & mut log. message . message ) ;
236236 if should_send_log {
237237 if let Ok ( serialized_log) = serde_json:: to_string ( & log) {
238+ // explicitly drop log so we don't accidentally re-use it and push
239+ // duplicate logs to the aggregator
240+ drop ( log) ;
238241 to_send. push ( serialized_log) ;
239242 }
240243 }
@@ -244,7 +247,8 @@ impl LambdaProcessor {
244247 orphan_log. message . lambda . request_id =
245248 Some ( self . invocation_context . request_id . clone ( ) ) ;
246249 if should_send_log {
247- if let Ok ( serialized_log) = serde_json:: to_string ( & log) {
250+ if let Ok ( serialized_log) = serde_json:: to_string ( & orphan_log) {
251+ drop ( orphan_log) ;
248252 to_send. push ( serialized_log) ;
249253 }
250254 }
You can’t perform that action at this time.
0 commit comments