summaryrefslogtreecommitdiff
path: root/upload-wiki.pl
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2014-02-20 11:55:43 +0100
committerAndras Timar <andras.timar@collabora.com>2014-02-20 11:55:43 +0100
commit2539bfabb242613f8ec788e6addcebcca576beee (patch)
treea41026c4a486c8ff9686bee08cf53653095a666f /upload-wiki.pl
parentaa981e2b1df11aebacf2d146ebf24895376324ad (diff)
Retry wiki page upload on error
Change-Id: I9a9621198d4fc02a03ef94eccdddb481109c73fd
Diffstat (limited to 'upload-wiki.pl')
-rwxr-xr-xupload-wiki.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/upload-wiki.pl b/upload-wiki.pl
index 8a789444b6..58de4fbe03 100755
--- a/upload-wiki.pl
+++ b/upload-wiki.pl
@@ -134,11 +134,19 @@ sub upload_article {
my $text = read_file( $_ );
+ RETRY:
print "Uploading page '$pagename'\n";
- $mw->edit( {
+ if ( $mw->edit( {
action => 'edit',
title => $pagename,
- text => $text }, { skip_encoding => 1 } ) || print 'Error: ' . $mw->{error}->{code} . ': ' . $mw->{error}->{details} . "\n";
+ text => $text }, { skip_encoding => 1 } ) )
+ {
+ print 'Error: ' . $mw->{error}->{code} . ': ' . $mw->{error}->{details} . "\n";
+ print "Waiting for 10 seconds...\n";
+ sleep 10;
+ print "Retry!\n";
+ goto RETRY;
+ }
}
File::Find::find( {wanted => \&upload_article}, 'wiki/' );