Обработка остановки сервера, фикс EventManager
This commit is contained in:
@@ -45,4 +45,17 @@ public class DeviceService extends Service<DeviceRepository> {
|
||||
return this.getRepository().countByField("publicKey", user.getPublicKey());
|
||||
}
|
||||
|
||||
/**
|
||||
* Обновляет время последней активности устройства
|
||||
* @param deviceId ID устройства
|
||||
*/
|
||||
public void updateDeviceLeaveTime(String deviceId) {
|
||||
Device device = this.getRepository().findByField("deviceId", deviceId);
|
||||
if(device == null) {
|
||||
return;
|
||||
}
|
||||
device.setLeaveTime(System.currentTimeMillis());
|
||||
this.getRepository().update(device);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user