Move handleDisconnect into BaseClientServer

It's called from there using self.handleDisconnect so define it there
as well.

Change-Id: I90fef55a79168e082e69f81a717c08badd4163a9
This commit is contained in:
Tobias Henkel 2020-03-24 17:43:46 +01:00
parent 9933f06821
commit 9261c8f4a7
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
1 changed files with 11 additions and 11 deletions

View File

@ -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.