Skip to content

Commit 75d0c2b

Browse files
committed
Fixing ubuntu version and PR comments
1 parent bc28c21 commit 75d0c2b

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ on:
1010
jobs:
1111
cancel_previous:
1212
permissions: write-all
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1414
steps:
1515
- uses: styfle/[email protected]
1616
with:
1717
workflow_id: ${{ github.event.workflow.id }}
1818

1919
build:
2020
needs: cancel_previous
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-22.04
2222

2323
steps:
2424
- uses: actions/checkout@v3

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
release:
1111
permissions: write-all
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
environment: deployment
1414

1515
steps:

Analytics-CSharp/Segment/Analytics/Utilities/SyncEventPipeline.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,10 @@ public SyncEventPipeline(
7171
public void Put(RawEvent @event) => _writeChannel.Send(@event);
7272

7373
public void Flush() {
74-
FlushEvent flushEvent = new FlushEvent(new SemaphoreSlim(1));
75-
// Set it up to be released by Upload
76-
flushEvent._semaphore.Wait();
77-
_writeChannel.Send(flushEvent);
78-
// Wait until the single slot in the semaphore is free. (if it's running!)
7974
if (Running && !_uploadChannel.isCancelled)
8075
{
76+
FlushEvent flushEvent = new FlushEvent(new SemaphoreSlim(0));
77+
_writeChannel.Send(flushEvent);
8178
flushEvent._semaphore.Wait(_flushTimeout, _flushCancellationToken);
8279
}
8380
}
@@ -155,7 +152,6 @@ private void Upload() => _analytics.AnalyticsScope.Launch(_analytics.NetworkIODi
155152
Analytics.Logger.Log(LogLevel.Debug, message: _logTag + " performing flush");
156153

157154
await Scope.WithContext(_analytics.FileIODispatcher, async () => await _storage.Rollover());
158-
await Task.Delay(1); // The rollover might not quite be done, even 1 ms prevents an empty URL list
159155

160156
string[] fileUrlList = _storage.Read(StorageConstants.Events).Split(',');
161157
foreach (string url in fileUrlList)

0 commit comments

Comments
 (0)