summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Henkel <tobias.henkel@bmw.de>2020-03-24 17:43:46 +0100
committerTobias Henkel <tobias.henkel@bmw.de>2020-03-24 17:43:46 +0100
commit9261c8f4a79971e5d5361dd2d0df902bdc44e394 (patch)
tree05b1dfba4852d7721c0d7f05be8612e6fa2ef6a5
parent9933f068213c9da6c4b0ea59659c13bcf2ebe104 (diff)
downloadgear-9261c8f4a79971e5d5361dd2d0df902bdc44e394.tar.gz
Move handleDisconnect into BaseClientServer
It's called from there using self.handleDisconnect so define it there as well. Change-Id: I90fef55a79168e082e69f81a717c08badd4163a9
-rw-r--r--gear/__init__.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/gear/__init__.py b/gear/__init__.py
index f7fc767..891804b 100644
--- a/gear/__init__.py
+++ b/gear/__init__.py
@@ -996,6 +996,17 @@ class BaseClientServer(object):
end = time.time()
self.reportTimingStats(packet.ptype, end - start)
+ def handleDisconnect(self, job):
+ """Handle a Gearman server disconnection.
+
+ If the Gearman server is disconnected, this will be called for any
+ jobs currently associated with the server.
+
+ :arg Job packet: The :py:class:`Job` that was running when the server
+ disconnected.
+ """
+ return job
+
def reportTimingStats(self, ptype, duration):
"""Report processing times by packet type
@@ -1696,17 +1707,6 @@ class Client(BaseClient):
packet.connection.handleOptionRes(packet.getArgument(0))
task.setComplete()
- def handleDisconnect(self, job):
- """Handle a Gearman server disconnection.
-
- If the Gearman server is disconnected, this will be called for any
- jobs currently associated with the server.
-
- :arg Job packet: The :py:class:`Job` that was running when the server
- disconnected.
- """
- return job
-
class FunctionRecord(object):
"""Represents a function that should be registered with Gearman.