use persistent jobs

This commit is contained in:
Graham Christensen 2017-10-31 04:06:14 -04:00
parent a996d75c4f
commit 8e84ed6a32
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 8 additions and 2 deletions

View file

@ -93,7 +93,10 @@ function runner($msg) {
echo "forwarding to build-jobs :)\n";
$message = new AMQPMessage(json_encode($forward),
array('content_type' => 'application/json'));
array(
'content_type' => 'application/json',
'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT,
));
$msg->delivery_info['channel']->basic_publish($message, 'build-jobs');
return true;
}

View file

@ -73,7 +73,10 @@ function runner($msg) {
];
$message = new AMQPMessage(json_encode($forward),
array('content_type' => 'application/json'));
array(
'content_type' => 'application/json',
'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT,
));
$msg->delivery_info['channel']->basic_publish($message, '', 'build-results');
$msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);