[livejournal] r21253: LJSUP-11381
Committer: gprochaev
LJSUP-11381Create counters for monitoring
Add timeout for mail send
U trunk/cgi-bin/LJ/NewWorker/TheSchwartz.pm U trunk/cgi-bin/ljlib.pl U trunk/cgi-bin/ljmail.pl U trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/LJ/NewWorker/TheSchwartz.pm
===================================================================
--- trunk/cgi-bin/LJ/NewWorker/TheSchwartz.pm 2012-02-27 12:47:31 UTC (rev 21252)
+++ trunk/cgi-bin/LJ/NewWorker/TheSchwartz.pm 2012-02-27 13:39:22 UTC (rev 21253)
@@ -3,6 +3,7 @@
use lib "$ENV{LJHOME}/cgi-bin";
use base "LJ::NewWorker", "Exporter";
+use POSIX ();
require "ljlib.pl";
my $interval = 10;
@@ -94,6 +95,7 @@
warn $@ if $@;
last if $opts->{'run_once'};
}
+ POSIX::_exit();
}
# Copy-pasted from 'old' Schwartz.
Modified: trunk/cgi-bin/ljlib.pl
===================================================================
--- trunk/cgi-bin/ljlib.pl 2012-02-27 12:47:31 UTC (rev 21252)
+++ trunk/cgi-bin/ljlib.pl 2012-02-27 13:39:22 UTC (rev 21253)
@@ -2424,6 +2424,8 @@
LJ::flush_cleanup_handlers();
LJ::disconnect_dbs() if $LJ::DISCONNECT_DBS;
LJ::MemCache::disconnect_all() if $LJ::DISCONNECT_MEMCACHE;
+
+ LJ::run_hooks("end_request");
}
# <LJFUNC>
Modified: trunk/cgi-bin/ljmail.pl
===================================================================
--- trunk/cgi-bin/ljmail.pl 2012-02-27 12:47:31 UTC (rev 21252)
+++ trunk/cgi-bin/ljmail.pl 2012-02-27 13:39:22 UTC (rev 21253)
@@ -280,7 +280,7 @@
## Optional params
# sender_id => "", ## stored in email headers. for debug.
- # timeout => 300, ## Default timeout for sending email is 300 sec.
+ timeout => 120, ## Default timeout for sending email is 300 sec.
});
## handle result
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl 2012-02-27 12:47:31 UTC (rev 21252)
+++ trunk/cgi-bin/ljprotocol.pl 2012-02-27 13:39:22 UTC (rev 21253)
@@ -523,6 +523,11 @@
props => { picture_keyword => $pk }
);
+ ## Counter "new_comment" for monitoring
+ LJ::run_hook ("update_counter", {
+ counter => "new_comment",
+ });
+
# OK
return {
status => "OK",
@@ -2756,6 +2761,11 @@
my $entry = LJ::Entry->new($uowner, jitemid => $jitemid, anum => $anum);
+ ## Counter "new_post" for monitoring
+ LJ::run_hook ("update_counter", {
+ counter => "new_post",
+ });
+
# run local site-specific actions
LJ::run_hooks("postpost", {
'itemid' => $jitemid,
