瀏覽代碼

ref #121, #122 Clear a native GearmanClient instace after success job call

to avoid side effects of re-applying servers, callback and so far
Veniamin Albaev 10 年之前
父節點
當前提交
bb75f241f7
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Service/GearmanClient.php

+ 6 - 0
Service/GearmanClient.php

@@ -252,6 +252,8 @@ class GearmanClient extends AbstractGearmanService
         $result = $gearmanClient->$method($worker['job']['realCallableName'], $params, $unique);
         $result = $gearmanClient->$method($worker['job']['realCallableName'], $params, $unique);
         $this->returnCode = $gearmanClient->returnCode();
         $this->returnCode = $gearmanClient->returnCode();
 
 
+        $this->gearmanClient = null;
+
         return $result;
         return $result;
     }
     }
 
 
@@ -449,6 +451,8 @@ class GearmanClient extends AbstractGearmanService
 
 
         $jobStatus = new JobStatus($statusData);
         $jobStatus = new JobStatus($statusData);
 
 
+        $this->gearmanClient = null;
+
         return $jobStatus;
         return $jobStatus;
     }
     }
 
 
@@ -686,6 +690,8 @@ class GearmanClient extends AbstractGearmanService
 
 
         $this->initTaskStructure();
         $this->initTaskStructure();
 
 
+        $this->gearmanClient = null;
+
         return $gearmanClient->runTasks();
         return $gearmanClient->runTasks();
     }
     }
 }
 }