diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-03-04 13:18:16 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-04 13:18:16 +1300 |
commit | b29929c4c8f78f665dd1614e43ee108c6eeeaa89 (patch) | |
tree | 240432ad7532d2cf501e57cbf27aeb3f4fc7939d /src/org | |
parent | 111c5ad0288dc4ff6d84039301010c4c11e40aa3 (diff) | |
parent | 4d540595df864fddbc04d65af55015084a89bf82 (diff) | |
download | trackermap-server-b29929c4c8f78f665dd1614e43ee108c6eeeaa89.tar.gz trackermap-server-b29929c4c8f78f665dd1614e43ee108c6eeeaa89.tar.bz2 trackermap-server-b29929c4c8f78f665dd1614e43ee108c6eeeaa89.zip |
Merge pull request #2974 from Abyss777/fix_infinit_reconnection
Schedule smpp reconnection only if current task stopped
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/smpp/SmppClient.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/org/traccar/smpp/SmppClient.java b/src/org/traccar/smpp/SmppClient.java index 3680d20e2..0bec60fd2 100644 --- a/src/org/traccar/smpp/SmppClient.java +++ b/src/org/traccar/smpp/SmppClient.java @@ -148,9 +148,11 @@ public class SmppClient { } public void scheduleReconnect() { - reconnectionTask = reconnectionExecutor.scheduleWithFixedDelay( - new ReconnectionTask(this), - reconnectionDelay, reconnectionDelay, TimeUnit.MILLISECONDS); + if (reconnectionTask == null || reconnectionTask.isDone()) { + reconnectionTask = reconnectionExecutor.scheduleWithFixedDelay( + new ReconnectionTask(this), + reconnectionDelay, reconnectionDelay, TimeUnit.MILLISECONDS); + } } private void stopReconnectionkTask() { |