File tree 3 files changed +5
-9
lines changed
Analytics-CSharp/Segment/Analytics/Utilities
3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 10
10
jobs :
11
11
cancel_previous :
12
12
permissions : write-all
13
- runs-on : ubuntu-latest
13
+ runs-on : ubuntu-22.04
14
14
steps :
15
15
16
16
with :
17
17
workflow_id : ${{ github.event.workflow.id }}
18
18
19
19
build :
20
20
needs : cancel_previous
21
- runs-on : ubuntu-latest
21
+ runs-on : ubuntu-22.04
22
22
23
23
steps :
24
24
- uses : actions/checkout@v3
Original file line number Diff line number Diff line change 9
9
jobs :
10
10
release :
11
11
permissions : write-all
12
- runs-on : ubuntu-latest
12
+ runs-on : ubuntu-22.04
13
13
environment : deployment
14
14
15
15
steps :
Original file line number Diff line number Diff line change @@ -71,13 +71,10 @@ public SyncEventPipeline(
71
71
public void Put ( RawEvent @event ) => _writeChannel . Send ( @event ) ;
72
72
73
73
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!)
79
74
if ( Running && ! _uploadChannel . isCancelled )
80
75
{
76
+ FlushEvent flushEvent = new FlushEvent ( new SemaphoreSlim ( 0 ) ) ;
77
+ _writeChannel . Send ( flushEvent ) ;
81
78
flushEvent . _semaphore . Wait ( _flushTimeout , _flushCancellationToken ) ;
82
79
}
83
80
}
@@ -155,7 +152,6 @@ private void Upload() => _analytics.AnalyticsScope.Launch(_analytics.NetworkIODi
155
152
Analytics . Logger . Log ( LogLevel . Debug , message : _logTag + " performing flush" ) ;
156
153
157
154
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
159
155
160
156
string [ ] fileUrlList = _storage . Read ( StorageConstants . Events ) . Split ( ',' ) ;
161
157
foreach ( string url in fileUrlList )
You can’t perform that action at this time.
0 commit comments