diff options
author | Anton Tananaev <atananaev@lyft.com> | 2020-12-28 17:02:23 -0800 |
---|---|---|
committer | Anton Tananaev <atananaev@lyft.com> | 2020-12-28 17:02:23 -0800 |
commit | 51704590a835057bf4850a5eaf8c5037d20f648a (patch) | |
tree | c38acebce6cfec36ead21918d6272a99452b9ac5 /src/main/java/org/traccar/api | |
parent | 551298664bbac541450d83a021a2f8d77e65b216 (diff) | |
download | traccar-server-51704590a835057bf4850a5eaf8c5037d20f648a.tar.gz traccar-server-51704590a835057bf4850a5eaf8c5037d20f648a.tar.bz2 traccar-server-51704590a835057bf4850a5eaf8c5037d20f648a.zip |
Migrate long config keys
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r-- | src/main/java/org/traccar/api/AsyncSocketServlet.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/api/AsyncSocketServlet.java b/src/main/java/org/traccar/api/AsyncSocketServlet.java index 51fbfb478..490fc89fc 100644 --- a/src/main/java/org/traccar/api/AsyncSocketServlet.java +++ b/src/main/java/org/traccar/api/AsyncSocketServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2016 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2020 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,13 @@ import org.eclipse.jetty.websocket.servlet.WebSocketServlet; import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory; import org.traccar.Context; import org.traccar.api.resource.SessionResource; +import org.traccar.config.Keys; public class AsyncSocketServlet extends WebSocketServlet { - private static final long ASYNC_TIMEOUT = 10 * 60 * 1000; - @Override public void configure(WebSocketServletFactory factory) { - factory.getPolicy().setIdleTimeout(Context.getConfig().getLong("web.timeout", ASYNC_TIMEOUT)); + factory.getPolicy().setIdleTimeout(Context.getConfig().getLong(Keys.WEB_TIMEOUT)); factory.setCreator((req, resp) -> { if (req.getSession() != null) { long userId = (Long) req.getSession().getAttribute(SessionResource.USER_ID_KEY); |