Skip to content

Commit

Permalink
Update to try to send as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny committed May 1, 2019
1 parent f52282c commit b2b31ad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,12 @@ public void Send(ITelemetry item)
}

/// <summary>
/// Flushes the in-memory buffer to disk.
/// Flushes the in-memory buffer to disk. And attempt to send
/// </summary>
public void Flush()
{
this.flushManager.Flush();
this.Transmitter.ForceImmediateSend();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,15 @@ private void AcquireMutex(Action action)
}
}

public void ForceImmediateSend()
{
foreach (var sender in this.senders)
{
sender.ForceSendNow();
}
}


/// <summary>
/// Create senders to send telemetries.
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions AppInsights.WindowsDesktop/PersistenceChannel/Sender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ public void Dispose()
}
}

internal void ForceSendNow()
{
// sets the delay handler to trigger an immediate sent
this.DelayHandler.Set();
}

/// <summary>
/// Stops the sender.
/// </summary>
Expand Down

0 comments on commit b2b31ad

Please sign in to comment.