Fix bug with improperly reported environment
When logging the edit environment, we were logging the newest environment being sent into the EventCoalescer on the latest activity log, when we should've been logging the environment that was associated with the ended period within the EventCoalescer.
This commit is contained in:
parent
35db07fff1
commit
f4c698ba27
2 changed files with 52 additions and 35 deletions
|
@ -404,10 +404,10 @@ impl Telemetry {
|
|||
|
||||
pub fn log_edit_event(self: &Arc<Self>, environment: &'static str) {
|
||||
let mut state = self.state.lock();
|
||||
let coalesced_duration = state.event_coalescer.log_event(environment);
|
||||
let period_data = state.event_coalescer.log_event(environment);
|
||||
drop(state);
|
||||
|
||||
if let Some((start, end)) = coalesced_duration {
|
||||
if let (Some((start, end)), Some(environment)) = period_data {
|
||||
let event = Event::Edit {
|
||||
duration: end.timestamp_millis() - start.timestamp_millis(),
|
||||
environment,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue