Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
digibib
deichman
Commits
bd0e800b
Commit
bd0e800b
authored
May 19, 2021
by
bensinober
Browse files
DEICH-5909
koha : make rabbitmq ACK confirmation optional
parent
17c3bb5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
koha/Deichman/MQueue.pm
View file @
bd0e800b
...
...
@@ -11,9 +11,9 @@ our $json = JSON::MaybeXS->new(utf8 => 1);
use
parent
"
Deichman::Main
";
sub
new
{
my
(
$class
)
=
@_
;
my
(
$class
,
$args
)
=
@_
;
my
$self
=
$class
->
SUPER::
new
();
$self
->
{
args
}
=
$args
;
bless
$self
,
$class
;
return
$self
;
}
...
...
@@ -69,15 +69,18 @@ sub openChannel {
Deichman::Exception::MQueue::
ChannelFailure
->
throw
(
$chan
);
}
$self
->
{
logger
}
->
info
("
Opened RabbitMQ channel
");
# Activate confirm
$mux
=
AnyEvent
->
condvar
;
$chan
->
confirm
(
on_success
=>
sub
{
$mux
->
send
},
on_failure
=>
sub
{
$mux
->
send
(
shift
)
},
);
my
$conf
=
$mux
->
recv
;
if
(
$conf
)
{
warn
Dumper
("
Failed activating confirm:
",
$conf
);
my
$confirm
=
$self
->
{
args
}
->
{
confirm
}
//
1
;
if
(
$confirm
)
{
# Activate confirm
$mux
=
AnyEvent
->
condvar
;
$chan
->
confirm
(
on_success
=>
sub
{
$mux
->
send
},
on_failure
=>
sub
{
$mux
->
send
(
shift
)
},
);
my
$conf
=
$mux
->
recv
;
if
(
$conf
)
{
warn
Dumper
("
Failed activating confirm:
",
$conf
);
}
}
$self
->
{
mqChan
}
=
$chan
;
return
$self
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment