mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-10-16 07:59:57 +00:00
Whitespace and style fixes
This commit is contained in:
parent
81da14a6a8
commit
2977ae61f1
10 changed files with 26 additions and 28 deletions
|
@ -26,15 +26,14 @@ class AutoUserDownload : BackgroundService {
|
||||||
.Select(g => g.Id)
|
.Select(g => g.Id)
|
||||||
.ToHashSet();
|
.ToHashSet();
|
||||||
// ...and if the guild contains any user data
|
// ...and if the guild contains any user data
|
||||||
IEnumerable<ulong> mustFetch;
|
HashSet<ulong> mustFetch;
|
||||||
try {
|
try {
|
||||||
await ConcurrentSemaphore.WaitAsync(token);
|
await ConcurrentSemaphore.WaitAsync(token);
|
||||||
using var db = new BotDatabaseContext();
|
using var db = new BotDatabaseContext();
|
||||||
mustFetch = db.UserEntries.AsNoTracking()
|
mustFetch = [.. db.UserEntries.AsNoTracking()
|
||||||
.Where(e => incompleteCaches.Contains(e.GuildId))
|
.Where(e => incompleteCaches.Contains(e.GuildId))
|
||||||
.Select(e => e.GuildId)
|
.Select(e => e.GuildId)
|
||||||
.Where(e => !_skippedGuilds.Contains(e))
|
.Where(e => !_skippedGuilds.Contains(e))];
|
||||||
.ToHashSet();
|
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
ConcurrentSemaphore.Release();
|
ConcurrentSemaphore.Release();
|
||||||
|
|
|
@ -13,9 +13,8 @@ class DataRetention : BackgroundService {
|
||||||
const int StaleGuildThreshold = 180;
|
const int StaleGuildThreshold = 180;
|
||||||
const int StaleUserThreashold = 360;
|
const int StaleUserThreashold = 360;
|
||||||
|
|
||||||
public DataRetention(ShardInstance instance) : base(instance) {
|
public DataRetention(ShardInstance instance) : base(instance)
|
||||||
ProcessInterval = 21600 / Shard.Config.BackgroundInterval; // Process about once per six hours
|
=> ProcessInterval = 21600 / Shard.Config.BackgroundInterval; // Process about once per six hours
|
||||||
}
|
|
||||||
|
|
||||||
public override async Task OnTick(int tickCount, CancellationToken token) {
|
public override async Task OnTick(int tickCount, CancellationToken token) {
|
||||||
// Run only a subset of shards each time, each running every ProcessInterval ticks.
|
// Run only a subset of shards each time, each running every ProcessInterval ticks.
|
||||||
|
|
Loading…
Reference in a new issue