File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 6
6
<Authors >devhl</Authors >
7
7
<Product />
8
8
<Description >Caches response from the Clash of Clans API.</Description >
9
- <Version >2.11.13-debug.4 </Version >
9
+ <Version >2.11.13-debug.5 </Version >
10
10
<AssemblyVersion >2.0.0.0</AssemblyVersion >
11
11
<FileVersion >2.0.0.0</FileVersion >
12
12
<GeneratePackageOnBuild >true</GeneratePackageOnBuild >
Original file line number Diff line number Diff line change 11
11
using Microsoft . Extensions . Options ;
12
12
using CocApi . Rest . Client ;
13
13
using CocApi . Cache . Services . Options ;
14
+ using System . Net . Mime ;
14
15
15
16
namespace CocApi . Cache . Services ;
16
17
@@ -51,7 +52,7 @@ public WarService(
51
52
Options = options ;
52
53
}
53
54
54
- private int _min = 0 ;
55
+ private int _min = int . MinValue ;
55
56
56
57
protected override async Task ExecuteScheduledTaskAsync ( CancellationToken cancellationToken )
57
58
{
@@ -87,7 +88,7 @@ protected override async Task ExecuteScheduledTaskAsync(CancellationToken cancel
87
88
88
89
debug = "d" ;
89
90
90
- _min = cachedWars . Min ( c => c . Id ) ;
91
+ _min = cachedWars . Count > 0 ? cachedWars . Min ( c => c . Id ) : int . MinValue ;
91
92
92
93
_id = cachedWars . Count == options . ConcurrentUpdates
93
94
? cachedWars . Max ( c => c . Id )
@@ -129,10 +130,13 @@ protected override async Task ExecuteScheduledTaskAsync(CancellationToken cancel
129
130
{
130
131
updatingWar . Add ( cachedWar . Key ) ;
131
132
}
132
- catch ( Exception )
133
+ catch ( Exception err )
133
134
{
134
135
erroredWarId = cachedWar . Id ;
135
- throw ;
136
+
137
+ Logger . LogError ( err , "Could not handle war id {warId}" , erroredWarId ) ;
138
+
139
+ continue ;
136
140
}
137
141
138
142
debug = "k" ;
You can’t perform that action at this time.
0 commit comments