undef $db;
}
}
+
+ method run_loop {
+ $self->connect_db;
+
+ for ( ;; ) {
+ $self->queue_songs( undef, sub { $self->run } );
+
+ $log->debug("Entering event loop. PID=$$");
+
+ my $result = $mpd->loop->run;
+ $log->trace( "Got loop result of " . ( $result // 'undef' ) );
+
+ if ( 'reload' eq $result ) {
+ $log->notice("disconnecting");
+ $self->stop;
+
+ exec( "$0", '--config', $self->cfg_file, '--skip-db-update' );
+ }
+ }
+ }
}