Skip to content

Commit 66476d3

Browse files
authored
Merge pull request #26 from stackify/feature/SF-6393-Millisecond-Ordering
SF-6393 Use 1 as the initial millisecond order
2 parents 3f233dc + 7cf7219 commit 66476d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Src/StackifyLib/Internal/Logs/LogClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public bool ErrorShouldBeSent(StackifyError error)
127127

128128

129129
private static long _lastEpochMs = 0;
130-
private static int _millisecondCount = 0;
130+
private static int _millisecondCount = 1;
131131

132132
public void QueueMessage(LogMsg msg)
133133
{
@@ -151,8 +151,8 @@ public void QueueMessage(LogMsg msg)
151151
// reset counter if we are no longer in the same ms
152152
//https://msdn.microsoft.com/en-us/library/system.threading.interlocked_methods(v=vs.110).aspx
153153
Interlocked.Exchange(ref _lastEpochMs, msg.EpochMs);
154-
Interlocked.Exchange(ref _millisecondCount, 0);
155-
msg.Order = 0;
154+
Interlocked.Exchange(ref _millisecondCount, 1);
155+
msg.Order = 1;
156156
}
157157
else if (_lastEpochMs == msg.EpochMs)
158158
{

0 commit comments

Comments
 (0)