diff options
author | Anton Tananaev <anton@traccar.org> | 2022-06-25 14:17:00 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-06-25 14:17:00 -0700 |
commit | 2fcffc5b55f59310d289a21d1ebc2ee6bf15bcd5 (patch) | |
tree | 89b881064fbd3ed3d258c183273a6d23ebd56a0f /src/main/java/org/traccar/api/AsyncSocket.java | |
parent | c53d98c668af9c79767e22964f05c7bf7dc866f2 (diff) | |
download | trackermap-server-2fcffc5b55f59310d289a21d1ebc2ee6bf15bcd5.tar.gz trackermap-server-2fcffc5b55f59310d289a21d1ebc2ee6bf15bcd5.tar.bz2 trackermap-server-2fcffc5b55f59310d289a21d1ebc2ee6bf15bcd5.zip |
Fix connection users issue
Diffstat (limited to 'src/main/java/org/traccar/api/AsyncSocket.java')
-rw-r--r-- | src/main/java/org/traccar/api/AsyncSocket.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/api/AsyncSocket.java b/src/main/java/org/traccar/api/AsyncSocket.java index 40aa68e88..5fc4b4412 100644 --- a/src/main/java/org/traccar/api/AsyncSocket.java +++ b/src/main/java/org/traccar/api/AsyncSocket.java @@ -58,15 +58,14 @@ public class AsyncSocket extends WebSocketAdapter implements ConnectionManager.U public void onWebSocketConnect(Session session) { super.onWebSocketConnect(session); - Map<String, Collection<?>> data = new HashMap<>(); try { + Map<String, Collection<?>> data = new HashMap<>(); data.put(KEY_POSITIONS, PositionUtil.getLatestPositions(storage, userId)); + sendData(data); + connectionManager.addListener(userId, this); } catch (StorageException e) { throw new RuntimeException(e); } - sendData(data); - - connectionManager.addListener(userId, this); } @Override |