Commit bd370f37 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 398707: whine.pl should use transactions for database interaction - Patch by…

Bug 398707: whine.pl should use transactions for database interaction - Patch by Emmanuel Seyman <eseyman@linagora.com> r/a=mkanat
parent 1aec31a1
...@@ -206,12 +206,7 @@ sub get_next_event { ...@@ -206,12 +206,7 @@ sub get_next_event {
# Loop until there's something to return # Loop until there's something to return
until (scalar keys %{$event}) { until (scalar keys %{$event}) {
$dbh->bz_lock_tables('whine_schedules WRITE', $dbh->bz_start_transaction();
'whine_events READ',
'profiles READ',
'groups READ',
'group_group_map READ',
'user_group_map READ');
# Get the event ID for the first pending schedule # Get the event ID for the first pending schedule
$sth_next_scheduled_event->execute; $sth_next_scheduled_event->execute;
...@@ -275,7 +270,7 @@ sub get_next_event { ...@@ -275,7 +270,7 @@ sub get_next_event {
reset_timer($sid); reset_timer($sid);
} }
$dbh->bz_unlock_tables(); $dbh->bz_commit_transaction();
# Only set $event if the user is allowed to do whining # Only set $event if the user is allowed to do whining
if ($owner->in_group('bz_canusewhines')) { if ($owner->in_group('bz_canusewhines')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment