Committer: gprochaev
LJSUP-8047. Need to add a parameter to function send_mailU trunk/cgi-bin/ljmail.pl
Modified: trunk/cgi-bin/ljmail.pl =================================================================== --- trunk/cgi-bin/ljmail.pl 2011-03-02 11:03:08 UTC (rev 18438) +++ trunk/cgi-bin/ljmail.pl 2011-03-02 11:11:37 UTC (rev 18439) @@ -196,22 +196,21 @@ ## Workers send emails too and exactly in this case ## we spend worker's time to try to send email directly from this process. ## This approach intended to reduce TheSchwartz workload. - if (!$opt->{'force_schwartz'} && !LJ::is_web_context()) { - @rcpts = _send_now( from => $from, rcpts => \@rcpts, text => $message_text ); - } - ## Do we still have someone to notify? - return 1 unless @rcpts; - ## Stage 2. ## Ok. We've tried to avoid this... But delayed sending. ## Deligate this job to SendMail worker. - if ($opt->{'force_schwartz'} || LJ::is_web_context()) { - _send_via_schwartz( from => $from, rcpts => \@rcpts, text => $message_text, opt => $opt ); - } - - + return _send_via_schwartz( from => $from, rcpts => \@rcpts, text => $message_text, opt => $opt ) + if $opt->{'force_schwartz'}; + + @rcpts = _send_now( from => $from, rcpts => \@rcpts, text => $message_text ) + if !LJ::is_web_context(); + + ## Do we still have someone to notify? + return 1 unless @rcpts; + + return _send_via_schwartz( from => $from, rcpts => \@rcpts, text => $message_text, opt => $opt ); } sub _send_via_schwartz {