Skip to content

Commit 7e88df1

Browse files
authored
Fix inside TaskRepository::findTasksForRebalance (#44)
* Added RebalanceService to rebalance tasks from unavailable to available hosts - fix inside findTasksForRebalance
1 parent 1eb84c5 commit 7e88df1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Model/Repository/Mysql/TaskRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ public function findTasksForRebalance(array $availableHostnames)
111111
{
112112
$query = sprintf('SELECT task_id FROM %s
113113
WHERE
114-
identifier NOT IN (:availableHostnames) AND status=:status AND ts_created <= :ts_created
114+
identifier NOT IN ("%s") AND status=:status AND ts_created <= :ts_created
115115
ORDER BY ts_created ASC LIMIT :limit',
116-
Consts::TASKS_TABLE_NAME
116+
Consts::TASKS_TABLE_NAME,
117+
implode('","', $availableHostnames)
117118
);
118119

119120
$stmt = $this->pdo->prepare($query);
120-
$stmt->bindValue(':availableHostnames', implode(',', $availableHostnames));
121121
$stmt->bindValue(':status', Consts::STATUS_PENDING, \PDO::PARAM_INT);
122122
$stmt->bindValue(':limit', self::REBALANCE_LIMIT, \PDO::PARAM_INT);
123123
$stmt->bindValue(':ts_created', time() + self::REBALANCE_TIME_IN_FUTURE, \PDO::PARAM_INT);

0 commit comments

Comments
 (0)