1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-06 05:28:15 -05:00

linq optimization for android devices in push service

This commit is contained in:
Kyle Spearrin 2016-06-29 01:17:44 -04:00
parent ef0a808687
commit b16c0ca087

View File

@ -252,12 +252,12 @@ namespace Bit.Core.Services
} }
// Android can send to many devices at once // Android can send to many devices at once
if(_gcmBroker != null && devices.Any(d => d.Type == DeviceType.Android)) var androidDevices = devices.Where(d => d.Type == DeviceType.Android);
if(_gcmBroker != null && androidDevices.Count() > 0)
{ {
_gcmBroker.QueueNotification(new GcmNotification _gcmBroker.QueueNotification(new GcmNotification
{ {
RegistrationIds = devices.Where(d => d.Type == DeviceType.Android) RegistrationIds = androidDevices.Select(d => d.PushToken).ToList(),
.Select(d => d.PushToken).ToList(),
Data = message Data = message
}); });
} }