Skip to content

Commit 13f374f

Browse files
Merge pull request #72 from nullinside-development-group/feat/concur
fix: concurrency issue when saving records
2 parents 02ea0b9 + 9c30a60 commit 13f374f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Nullinside.Api.TwitchBot/Model/NullinsideContextExtensions.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,13 @@ await db.TwitchUser.UpsertRange(
174174
BannedUserTwitchId = i.Id,
175175
Reason = reason,
176176
Timestamp = DateTime.UtcNow
177-
}));
177+
}).ToList());
178+
179+
// Trying to fix bug?
180+
foreach (TwitchBan twitchBan in db.TwitchBan) {
181+
db.Entry(twitchBan).State = EntityState.Added;
182+
}
183+
178184
await db.SaveChangesAsync(stoppingToken);
179185
}
180186
}

src/nullinside-api

0 commit comments

Comments
 (0)