Committer: sbelyaev
LJSUP-10503: duplication of delay postsU trunk/cgi-bin/LJ/DelayedEntry.pm
Modified: trunk/cgi-bin/LJ/DelayedEntry.pm =================================================================== --- trunk/cgi-bin/LJ/DelayedEntry.pm 2012-09-07 12:37:51 UTC (rev 22837) +++ trunk/cgi-bin/LJ/DelayedEntry.pm 2012-09-07 13:03:12 UTC (rev 22838) @@ -254,16 +254,27 @@ my ($self) = @_; my $time = time(); - return $self->journal->do( "UPDATE delayedlog2 SET ". - "lastposttry=? " . - "WHERE delayedid = ? AND " . - "journalid = ? AND " . - "lastposttry = ?" , - undef, - $time, - $self->delayedid, - $self->journalid, - $self->{lastposttry}, ); + if (!$self->{lastposttry}) { + return $self->journal->do( "UPDATE delayedlog2 SET ". + "lastposttry=? " . + "WHERE delayedid = ? AND " . + "journalid = ?" . + undef, + $time, + $self->delayedid, + $self->journalid, ); + } else { + return $self->journal->do( "UPDATE delayedlog2 SET ". + "lastposttry=? " . + "WHERE delayedid = ? AND " . + "journalid = ? AND " . + "lastposttry = ?" , + undef, + $time, + $self->delayedid, + $self->journalid, + $self->{lastposttry}, ); + } } sub convert_from_data {