⚡ Optimize bulk insert on conflict options
This commit is contained in:
		| @@ -62,7 +62,7 @@ public class AccountService( | ||||
|         if (missingId.Count != 0) | ||||
|         { | ||||
|             var newProfiles = missingId.Select(id => new Profile { AccountId = id }).ToList(); | ||||
|             await db.BulkInsertAsync(newProfiles); | ||||
|             await db.BulkInsertAsync(newProfiles, config => config.ConflictOption = ConflictOption.Ignore); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -11,7 +11,7 @@ public class ActionLogFlushHandler(IServiceProvider serviceProvider) : IFlushHan | ||||
|         using var scope = serviceProvider.CreateScope(); | ||||
|         var db = scope.ServiceProvider.GetRequiredService<AppDatabase>(); | ||||
|  | ||||
|         await db.BulkInsertAsync(items); | ||||
|         await db.BulkInsertAsync(items, config => config.ConflictOption = ConflictOption.Ignore); | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user