File tree 3 files changed +7
-9
lines changed
DotJEM.Json.Index2.Management/Writer
3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -150,14 +150,16 @@ private void Commit()
150
150
if ( callsRead < 1 )
151
151
return ;
152
152
153
+ using ILease < IndexWriter > lease = target . WriterLease ;
153
154
try
154
155
{
155
- using ILease < IndexWriter > lease = target . WriterLease ;
156
156
lease . Value . Commit ( ) ;
157
157
}
158
158
catch ( Exception e )
159
159
{
160
- target . infoStream . WriteError ( "Failed to commit indexed data to storage." , e ) ;
160
+ bool leaseExpired = lease . IsExpired ;
161
+
162
+ target . infoStream . WriteError ( $ "Failed to commit indexed data to storage. { leaseExpired } ", e ) ;
161
163
// SWALLOW FOR NOW
162
164
}
163
165
}
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ public IndexWriter Value
165
165
}
166
166
}
167
167
168
- public bool IsExpired => DateTime . Now - leaseTime > TimeSpan . FromSeconds ( 5 ) ;
168
+ public bool IsExpired => ( DateTime . Now - leaseTime > TimeSpan . FromSeconds ( 5 ) ) || IsDisposed ;
169
169
170
170
public TimeLimitedIndexWriterLease ( IndexWriterManager manager , Action < TimeLimitedIndexWriterLease > onReturned )
171
171
{
@@ -181,9 +181,6 @@ protected override void Dispose(bool disposing)
181
181
182
182
public void Wait ( )
183
183
{
184
- if ( IsDisposed )
185
- return ;
186
-
187
184
if ( IsExpired )
188
185
return ;
189
186
Original file line number Diff line number Diff line change @@ -36,9 +36,6 @@ public Directory Directory
36
36
{
37
37
get
38
38
{
39
- if ( directory != null )
40
- return directory ;
41
-
42
39
lock ( padlock )
43
40
{
44
41
if ( directory != null )
@@ -83,6 +80,8 @@ public void Delete()
83
80
foreach ( string file in directory . ListAll ( ) )
84
81
directory . DeleteFile ( file ) ;
85
82
provider . Delete ( ) ;
83
+
84
+
86
85
}
87
86
}
88
87
}
You can’t perform that action at this time.
0 commit comments