X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=lib%2FApp%2FMPD%2FFeeder%2FOptions.pm;h=83f422250f27bb09e31930598f2cfd6516bd8d1d;hb=841c96b547cd0896e244747857af7556b2a98e38;hp=eff87be8ba0ff1000752fe2d1b7a6ca4c076f2b3;hpb=9fe127e76f7ec2335c80b3ba78afcd050d16a47c;p=mpd-feeder.git diff --git a/lib/App/MPD/Feeder/Options.pm b/lib/App/MPD/Feeder/Options.pm index eff87be..83f4222 100644 --- a/lib/App/MPD/Feeder/Options.pm +++ b/lib/App/MPD/Feeder/Options.pm @@ -18,6 +18,8 @@ has $min_album_interval :reader = parse_duration('5h'); has $min_song_interval :reader = parse_duration('13d'); has $min_artist_interval :reader = parse_duration('1h 15m'); has $skip_db_update :reader = 0; +has $initial_reconnect_delay :reader = parse_duration('3 seconds'); +has $max_reconnect_delay :reader = parse_duration('2 minutes'); method parse_command_line { Getopt::Long::GetOptions( @@ -63,6 +65,9 @@ method dump { say "[mpd]"; say "host = " . ( $mpd_host // '' ); say "port = " . ( $mpd_port // '' ); + say "initial-reconnect-delay = " + . duration_exact($initial_reconnect_delay); + say "max-reconnect-delay = " . duration_exact($max_reconnect_delay); say ""; say "[queue]"; say "target-length = $target_queue_length"; @@ -89,6 +94,14 @@ method parse_config_file($path) { handle_config_option( $ini => mpd => host => \$mpd_host ); handle_config_option( $ini => mpd => port => \$mpd_port ); + handle_config_option( + $ini => mpd => 'initial-reconnect-delay' => \$initial_reconnect_delay, + \&parse_duration + ); + handle_config_option( + $ini => mpd => 'max-reconnect-delay' => \$max_reconnect_delay, + \&parse_duration + ); handle_config_option( $ini => 'mpd-feeder' => log_level => \$log_level );