Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions EVEData/EveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3763,7 +3763,10 @@

string userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0";
hc.DefaultRequestHeaders.Add("User-Agent", userAgent);
hc.DefaultRequestHeaders.IfModifiedSince = LastDotlanUpdate;
if(LastDotlanUpdate != DateTime.MinValue)
{
hc.DefaultRequestHeaders.IfModifiedSince = LastDotlanUpdate;
}

// set the etag if we have one
if(LastDotlanETAG != "")
Expand All @@ -3789,8 +3792,9 @@

if(response.StatusCode == HttpStatusCode.NotModified)
{
// we shouldn't hit this; the first request should update the request beyond the last-modified expiring
// LastDotlanUpdate = DateTime.Now;
// Data hasn't changed; push next check out by ~1 hour to avoid hammering
Random rndUpdateOffset = new Random();
NextDotlanUpdate = DateTime.Now + TimeSpan.FromMinutes(60) + TimeSpan.FromSeconds(rndUpdateOffset.Next(1, 300));
}
else
{
Expand All @@ -3815,7 +3819,7 @@
}
}
}
catch(Exception e)

Check warning on line 3822 in EVEData/EveManager.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'e' is declared but never used

Check warning on line 3822 in EVEData/EveManager.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'e' is declared but never used
{
}
}
Expand Down Expand Up @@ -4237,7 +4241,7 @@
}
}
}
catch (Exception ex)

Check warning on line 4244 in EVEData/EveManager.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'ex' is declared but never used

Check warning on line 4244 in EVEData/EveManager.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'ex' is declared but never used
{
// Log error if needed
}
Expand Down Expand Up @@ -4269,7 +4273,7 @@

File.WriteAllLines(filePath, lines);
}
catch (Exception ex)

Check warning on line 4276 in EVEData/EveManager.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'ex' is declared but never used

Check warning on line 4276 in EVEData/EveManager.cs

View workflow job for this annotation

GitHub Actions / build

The variable 'ex' is declared but never used
{
// Log error if needed
}
Expand Down
Loading