Committer: ailyin
LJSV-1715 (Entries failing to crosspost to Facebook)U trunk/cgi-bin/LJ/Worker/Repost/CommentToFacebook.pm U trunk/cgi-bin/LJ/Worker/Repost/CommentToTwitter.pm U trunk/cgi-bin/LJ/Worker/Repost/CommentToVkontakte.pm U trunk/cgi-bin/LJ/Worker/Repost/EntryToFacebook.pm U trunk/cgi-bin/LJ/Worker/Repost/EntryToTwitter.pm U trunk/cgi-bin/LJ/Worker/Repost/EntryToVkontakte.pm
Modified: trunk/cgi-bin/LJ/Worker/Repost/CommentToFacebook.pm =================================================================== --- trunk/cgi-bin/LJ/Worker/Repost/CommentToFacebook.pm 2011-08-17 09:33:10 UTC (rev 10877) +++ trunk/cgi-bin/LJ/Worker/Repost/CommentToFacebook.pm 2011-08-17 09:55:13 UTC (rev 10878) @@ -24,6 +24,10 @@ my $journal = LJ::load_userid($arg->{'journalid'}); my $comment = LJ::Comment->new($journal, 'jtalkid' => $arg->{'jtalkid'}); + # if it has somehow disappeared in the meantime, pretend everything + # is fine and don't even attempt to repost + return $job->completed unless $comment->valid; + my $comment_url = $comment->url; if ( my $partner = Modified: trunk/cgi-bin/LJ/Worker/Repost/CommentToTwitter.pm =================================================================== --- trunk/cgi-bin/LJ/Worker/Repost/CommentToTwitter.pm 2011-08-17 09:33:10 UTC (rev 10877) +++ trunk/cgi-bin/LJ/Worker/Repost/CommentToTwitter.pm 2011-08-17 09:55:13 UTC (rev 10878) @@ -16,6 +16,10 @@ my $journal = LJ::load_userid($arg->{'journalid'}); my $comment = LJ::Comment->new($journal, 'jtalkid' => $arg->{'jtalkid'}); + # if it has somehow disappeared in the meantime, pretend everything + # is fine and don't even attempt to repost + return $job->completed unless $comment->valid; + my $comment_url = $comment->url; if ( my $partner = Modified: trunk/cgi-bin/LJ/Worker/Repost/CommentToVkontakte.pm =================================================================== --- trunk/cgi-bin/LJ/Worker/Repost/CommentToVkontakte.pm 2011-08-17 09:33:10 UTC (rev 10877) +++ trunk/cgi-bin/LJ/Worker/Repost/CommentToVkontakte.pm 2011-08-17 09:55:13 UTC (rev 10878) @@ -16,6 +16,10 @@ my $journal = LJ::load_userid($arg->{'journalid'}); my $comment = LJ::Comment->new($journal, 'jtalkid' => $arg->{'jtalkid'}); + # if it has somehow disappeared in the meantime, pretend everything + # is fine and don't even attempt to repost + return $job->completed unless $comment->valid; + my $comment_url = $comment->url; if ( my $partner = Modified: trunk/cgi-bin/LJ/Worker/Repost/EntryToFacebook.pm =================================================================== --- trunk/cgi-bin/LJ/Worker/Repost/EntryToFacebook.pm 2011-08-17 09:33:10 UTC (rev 10877) +++ trunk/cgi-bin/LJ/Worker/Repost/EntryToFacebook.pm 2011-08-17 09:55:13 UTC (rev 10878) @@ -22,6 +22,10 @@ my $journal = LJ::load_userid($arg->{'journalid'}); my $entry = LJ::Entry->new($journal, 'jitemid' => $arg->{'jitemid'}); + # if it has somehow disappeared in the meantime, pretend everything + # is fine and don't even attempt to repost + return $job->completed unless $entry->valid; + my $data = { 'access_token' => $poster->prop('facebook_access_token'), 'link' => $entry->url, Modified: trunk/cgi-bin/LJ/Worker/Repost/EntryToTwitter.pm =================================================================== --- trunk/cgi-bin/LJ/Worker/Repost/EntryToTwitter.pm 2011-08-17 09:33:10 UTC (rev 10877) +++ trunk/cgi-bin/LJ/Worker/Repost/EntryToTwitter.pm 2011-08-17 09:55:13 UTC (rev 10878) @@ -14,6 +14,10 @@ my $journal = LJ::load_userid($arg->{'journalid'}); my $entry = LJ::Entry->new($journal, 'jitemid' => $arg->{'jitemid'}); + # if it has somehow disappeared in the meantime, pretend everything + # is fine and don't even attempt to repost + return $job->completed unless $entry->valid; + my $short_url = $class->shorten_url($entry->url); my $title = $entry->subject_raw || $entry->event_raw; Modified: trunk/cgi-bin/LJ/Worker/Repost/EntryToVkontakte.pm =================================================================== --- trunk/cgi-bin/LJ/Worker/Repost/EntryToVkontakte.pm 2011-08-17 09:33:10 UTC (rev 10877) +++ trunk/cgi-bin/LJ/Worker/Repost/EntryToVkontakte.pm 2011-08-17 09:55:13 UTC (rev 10878) @@ -14,6 +14,10 @@ my $journal = LJ::load_userid($arg->{'journalid'}); my $entry = LJ::Entry->new($journal, 'jitemid' => $arg->{'jitemid'}); + # if it has somehow disappeared in the meantime, pretend everything + # is fine and don't even attempt to repost + return $job->completed unless $entry->valid; + my $short_url = $class->shorten_url($entry->url); my $title = $entry->subject_raw || $entry->event_raw;