diff options
Diffstat (limited to 'upload-wiki.pl')
-rwxr-xr-x | upload-wiki.pl | 12 |
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/' ); |