sync: refactor sync device service to be more memory efficient

This commit is contained in:
Abdullah Atta
2024-06-07 10:55:15 +05:00
parent 7ce02d0193
commit 0c0ade0c64
4 changed files with 127 additions and 73 deletions

View File

@@ -44,7 +44,7 @@ namespace Notesnook.API.Controllers
try
{
var userId = this.User.FindFirstValue("sub");
SyncDeviceService.RegisterDevice(userId, deviceId);
new SyncDeviceService(new SyncDevice(ref userId, ref deviceId)).RegisterDevice();
return Ok();
}
catch (Exception ex)
@@ -61,7 +61,7 @@ namespace Notesnook.API.Controllers
try
{
var userId = this.User.FindFirstValue("sub");
SyncDeviceService.UnregisterDevice(userId, deviceId);
new SyncDeviceService(new SyncDevice(ref userId, ref deviceId)).UnregisterDevice();
return Ok();
}
catch (Exception ex)