Lines 1445-1452
sub _set_message_status {
Link Here
|
1445 |
my $dbh = C4::Context->dbh(); |
1445 |
my $dbh = C4::Context->dbh(); |
1446 |
my $statement = 'UPDATE message_queue SET status= ? WHERE message_id = ?'; |
1446 |
my $statement = 'UPDATE message_queue SET status= ? WHERE message_id = ?'; |
1447 |
my $sth = $dbh->prepare( $statement ); |
1447 |
my $sth = $dbh->prepare( $statement ); |
|
|
1448 |
|
1449 |
my $lock_sth = $dbh->prepare('LOCK TABLES message_queue WRITE'); |
1450 |
my $attempts = 0; |
1451 |
until ( $sth->execute() ) { |
1452 |
$attempts++; |
1453 |
die 'Unable to lock message_queue to update message status: ' . $dbh->errstr() if $attempts > 10; |
1454 |
sleep 1; |
1455 |
} |
1456 |
|
1448 |
my $result = $sth->execute( $params->{'status'}, |
1457 |
my $result = $sth->execute( $params->{'status'}, |
1449 |
$params->{'message_id'} ); |
1458 |
$params->{'message_id'} ); |
|
|
1459 |
|
1460 |
$dbh->do('UNLOCK TABLES'); |
1461 |
|
1450 |
return $result; |
1462 |
return $result; |
1451 |
} |
1463 |
} |
1452 |
|
1464 |
|
1453 |
- |
|
|