mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
sync: improve perf of user account reset & deletion
this adds a new UserId index in all the notesnook collections which helps to speed up the deletion time during account reset & delete. This fixes the request timeout issues during both of these processes.
This commit is contained in:
@@ -173,7 +173,10 @@ namespace Notesnook.API.Services
|
||||
Repositories.Contents.DeleteByUserId(userId);
|
||||
Repositories.Settings.DeleteByUserId(userId);
|
||||
Repositories.Attachments.DeleteByUserId(userId);
|
||||
Repositories.Reminders.DeleteByUserId(userId);
|
||||
Repositories.Relations.DeleteByUserId(userId);
|
||||
Repositories.UsersSettings.Delete((u) => u.UserId == userId);
|
||||
Repositories.Monographs.DeleteMany((m) => m.UserId == userId);
|
||||
|
||||
if (!Constants.IS_SELF_HOSTED)
|
||||
{
|
||||
@@ -211,6 +214,8 @@ namespace Notesnook.API.Services
|
||||
Repositories.Contents.DeleteByUserId(userId);
|
||||
Repositories.Settings.DeleteByUserId(userId);
|
||||
Repositories.Attachments.DeleteByUserId(userId);
|
||||
Repositories.Reminders.DeleteByUserId(userId);
|
||||
Repositories.Relations.DeleteByUserId(userId);
|
||||
Repositories.Monographs.DeleteMany((m) => m.UserId == userId);
|
||||
if (!await unit.Commit()) return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user