]> git.openstreetmap.org Git - rails.git/blobdiff - script/misc/update-wiki-pages
update-wiki-pages: adding retry and timeout
[rails.git] / script / misc / update-wiki-pages
index 84e1e8a1c51117bf9673976cde7ef982cfab2934..50f994c0755fd027bc239d0542fb834639227f8c 100755 (executable)
@@ -3,20 +3,11 @@ use 5.010;
 use strict;
 use warnings;
 
-use Pod::Usage ();
-use Getopt::Long ();
-
-BEGIN {
-    eval "require MediaWiki::API; require YAML::XS;" or do {
-        print "You have to install some modules via CPAN to run this:\n";
-        print "   sudo cpanp MediaWiki::API YAML::XS\n";
-        exit 1;
-    };
-}
-
+use Getopt::Long;
+use Pod::Usage;
 use MediaWiki::API;
+use Test::More qw(no_plan);
 use YAML::XS qw(Dump);
-use Test::More 'no_plan';
 
 =head1 NAME
 
@@ -51,6 +42,8 @@ help() unless -f $out_file;
 my $mw = MediaWiki::API->new();
 ok($mw, "Got a MediaWiki API");
 $mw->{config}->{api_url} = 'https://wiki.openstreetmap.org/w/api.php';
+$mw->{config}->{retries} = 5;
+$mw->{config}->{retry_delay} = 30;
 
 # All our goodies
 my (%feature, %count);