Skip to content

Commit

Permalink
Merge pull request #104 from p-alik/http-plugin
Browse files Browse the repository at this point in the history
gearmand should release http client if request contains 'X-Gearman-Background: true' header

Reviewed-by: https://github.com/bonnyci[bot]
  • Loading branch information
bonnyci[bot] authored May 18, 2017
2 parents 4ee46f8 + c906a12 commit e3dbdda
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions libgearman-server/plugins/protocol/http/protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,15 @@ class HTTPtext : public gearmand::protocol::Context

case GEARMAN_COMMAND_JOB_CREATED:
{
gearmand_log_debug(GEARMAN_DEFAULT_LOG_PARAM,
"Sending HTTP told to ignore packet: gearmand_command_t:%s",
gearman_strcommand(packet->command));
ret_ptr= GEARMAND_IGNORE_PACKET;
return 0;
if(this->_background) {
ret_ptr = GEARMAND_SUCCESS;
} else {
gearmand_log_debug(GEARMAN_DEFAULT_LOG_PARAM,
"Sending HTTP told to ignore packet: gearmand_command_t:%s",
gearman_strcommand(packet->command));
ret_ptr= GEARMAND_IGNORE_PACKET;
return 0;
}
}
}

Expand Down

0 comments on commit e3dbdda

Please sign in to comment.