92ac25a
From 9261c8f4a79971e5d5361dd2d0df902bdc44e394 Mon Sep 17 00:00:00 2001
92ac25a
From: Tobias Henkel <tobias.henkel@bmw.de>
92ac25a
Date: Tue, 24 Mar 2020 17:43:46 +0100
92ac25a
Subject: [PATCH 2/9] Move handleDisconnect into BaseClientServer
92ac25a
92ac25a
It's called from there using self.handleDisconnect so define it there
92ac25a
as well.
92ac25a
92ac25a
Change-Id: I90fef55a79168e082e69f81a717c08badd4163a9
92ac25a
Signed-off-by: Matthieu Huin <mhuin@redhat.com>
92ac25a
---
92ac25a
 gear/__init__.py | 22 +++++++++++-----------
92ac25a
 1 file changed, 11 insertions(+), 11 deletions(-)
92ac25a
92ac25a
diff --git a/gear/__init__.py b/gear/__init__.py
92ac25a
index f7fc767..891804b 100644
92ac25a
--- a/gear/__init__.py
92ac25a
+++ b/gear/__init__.py
92ac25a
@@ -996,6 +996,17 @@ class BaseClientServer(object):
92ac25a
         end = time.time()
92ac25a
         self.reportTimingStats(packet.ptype, end - start)
92ac25a
 
92ac25a
+    def handleDisconnect(self, job):
92ac25a
+        """Handle a Gearman server disconnection.
92ac25a
+
92ac25a
+        If the Gearman server is disconnected, this will be called for any
92ac25a
+        jobs currently associated with the server.
92ac25a
+
92ac25a
+        :arg Job packet: The :py:class:`Job` that was running when the server
92ac25a
+            disconnected.
92ac25a
+        """
92ac25a
+        return job
92ac25a
+
92ac25a
     def reportTimingStats(self, ptype, duration):
92ac25a
         """Report processing times by packet type
92ac25a
 
92ac25a
@@ -1696,17 +1707,6 @@ class Client(BaseClient):
92ac25a
         packet.connection.handleOptionRes(packet.getArgument(0))
92ac25a
         task.setComplete()
92ac25a
 
92ac25a
-    def handleDisconnect(self, job):
92ac25a
-        """Handle a Gearman server disconnection.
92ac25a
-
92ac25a
-        If the Gearman server is disconnected, this will be called for any
92ac25a
-        jobs currently associated with the server.
92ac25a
-
92ac25a
-        :arg Job packet: The :py:class:`Job` that was running when the server
92ac25a
-            disconnected.
92ac25a
-        """
92ac25a
-        return job
92ac25a
-
92ac25a
 
92ac25a
 class FunctionRecord(object):
92ac25a
     """Represents a function that should be registered with Gearman.
92ac25a
-- 
92ac25a
2.31.1
92ac25a