madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22562: LJSUP-13181: there are two notification ...

Committer: sbelyaev
LJSUP-13181: there are two notification of birthday for one user
U   trunk/bin/worker/birthday-notify
Modified: trunk/bin/worker/birthday-notify
===================================================================
--- trunk/bin/worker/birthday-notify	2012-08-03 09:08:11 UTC (rev 22561)
+++ trunk/bin/worker/birthday-notify	2012-08-03 09:31:57 UTC (rev 22562)
@@ -137,18 +137,12 @@
         debug("Firing off notification for " . $u->user);
         LJ::Event::Birthday->new($u)->fire;
 
-        my     #  0    1    2     3     4    5     6     7  
-            ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) =
-                                            gmtime(time);
+        my $notify = DateTime->from_epoch( epoch => $bdays->{$u->id} );
+        $notify->set_second(0);
+        $notify->set_minute(0);
+        $notify->set_hour($notify->hour % 12);
 
-        $sec  = 0;
-        $min  = 0;
-        $hour = ($hour % 12);
-
-        my $notify_time 
-            = POSIX::mktime($sec, $min, $hour, $mday, $mon, $year, $wday, $yday);
-
-        LJ::Event::Birthday->new($u, $notify_time)->fire;
+        LJ::Event::Birthday->new($u, $notify->epoch)->fire;
         $ct++;
     }
 

Tags: livejournal, madeon, sbelyaev
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