vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r15241: LJSUP-4369:

Committer: vad
LJSUP-4369:
added interface to mark alerts as readed.
added worker to remove outdated comet history records from DB.

A   branches/msn/bin/worker/clean_comet_history
A   branches/msn/htdocs/alerts/
A   branches/msn/htdocs/alerts/mark_readed.bml
Added: branches/msn/bin/worker/clean_comet_history
===================================================================
--- branches/msn/bin/worker/clean_comet_history	                        (rev 0)
+++ branches/msn/bin/worker/clean_comet_history	2009-06-04 08:51:06 UTC (rev 15241)
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+use strict;
+use lib "$ENV{LJHOME}/cgi-bin";
+
+#LJ::Worker::CleanCometHistory->run;
+LJ::Worker::CleanCometHistory->work;
+
+package LJ::Worker::CleanCometHistory;
+use base 'LJ::Worker::Manual';
+use LJ::Comet::History;
+
+sub on_idle {
+    return 24*60*60; # once a day
+}
+
+# return 1 if we did work, false if not.
+sub work {
+    my $class = shift;
+
+    return LJ::Comet::History->remove_outdated();
+
+}
+


Property changes on: branches/msn/bin/worker/clean_comet_history
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/msn/htdocs/alerts/mark_readed.bml
===================================================================
--- branches/msn/htdocs/alerts/mark_readed.bml	                        (rev 0)
+++ branches/msn/htdocs/alerts/mark_readed.bml	2009-06-04 08:51:06 UTC (rev 15241)
@@ -0,0 +1,18 @@
+<?_code
+{
+    # Remove viewed users alerts.
+    use strict;
+    use LJ::Comet::History qw//;
+    use vars qw(%GET);
+    
+    my $remote = LJ::get_remote();
+    return "Error: unautharized access" unless $remote;
+    
+    my $to = int $GET{to};
+    return "Error: readed alert id does not provided" unless $to;
+    
+    LJ::Comet::History->mark_as_readed($remote, $to, 'alert');
+    return "ok";
+    
+}
+_code?>

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