blob: 284346500a93fecc5cfa4b08535f5f3e78384cd8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
--- ./Net/Gearman/Client.php.orig 2013-03-13 17:50:59.000000000 +0800
+++ ./Net/Gearman/Client.php 2013-03-13 17:51:18.000000000 +0800
@@ -166,11 +166,11 @@
$s = $this->getConnection();
Net_Gearman_Connection::send($s, $type, $params);
- if (!is_array(Net_Gearman_Connection::$waiting[$s])) {
- Net_Gearman_Connection::$waiting[$s] = array();
+ if (!is_array(Net_Gearman_Connection::$waiting[(int) $s])) {
+ Net_Gearman_Connection::$waiting[(int) $s] = array();
}
- array_push(Net_Gearman_Connection::$waiting[$s], $task);
+ array_push(Net_Gearman_Connection::$waiting[(int) $s], $task);
}
/**
@@ -244,7 +244,7 @@
$task->fail();
break;
case 'job_created':
- $task = array_shift(Net_Gearman_Connection::$waiting[$s]);
+ $task = array_shift(Net_Gearman_Connection::$waiting[(int) $s]);
$task->handle = $resp['data']['handle'];
if ($task->type == Net_Gearman_Task::JOB_BACKGROUND) {
$task->finished = true;
|