wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r18439: LJSUP-8047. Need to add a parameter to f...

Committer: gprochaev
LJSUP-8047. Need to add a parameter to function send_mail

U   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 {

Tags: livejournal, pl, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments