Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
Resolve a few warnings and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
schnapster committed Mar 11, 2018
1 parent 6040564 commit 601bfbe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion FredBoat/src/main/java/fredboat/api/API.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static void start(PlayerRegistry playerRegistry, BotMetrics botMetrics, S

public static void turnOnMetrics(MetricsServletAdapter metricsServlet) {
if (!Launcher.getBotController().getAppConfig().isRestServerEnabled()) {
log.warn("Rest server is not enabled. Skipping Spark ignition!");
log.warn("Rest server is not enabled. Metrics will not be scrapable!");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public RepoConfiguration(BackendConfig backendConfig, ShutdownHandler shutdownHa
String ourVersion = Integer.toString(RestRepo.API_VERSION);
if (supportedApiVersions.contains(ourVersion)
|| supportedApiVersions.contains("v" + ourVersion)) {
log.info("Using Quaterdeck API v{}", ourVersion);
log.info("Using Quarterdeck API v{}", ourVersion);
} else {
log.error("Quarterdeck API does not support our expected version v{}. Update quarterdeck, or roll back this FredBoat version!", ourVersion);
shutdownHandler.shutdown(ExitCodes.EXIT_CODE_ERROR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import fredboat.feature.I18n;
import fredboat.jda.JdaEntityProvider;
import fredboat.messaging.CentralMessaging;
import fredboat.shared.constant.DistributionEnum;
import fredboat.shared.constant.ExitCodes;
import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.entities.Guild;
Expand Down Expand Up @@ -189,7 +190,7 @@ public void handlePreShutdown(int code) {
@Override
public void onReady(ReadyEvent event) {
//the current implementation of music persistence is not a good idea on big bots
if (credentials.getRecommendedShardCount() <= 10) {
if (credentials.getRecommendedShardCount() <= 10 && appConfig.getDistribution() != DistributionEnum.MUSIC) {
try {
reloadPlaylists(event.getJDA());
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public SpotifyAPIWrapper(Credentials credentials) {
* https://developer.spotify.com/web-api/authorization-guide/#client-credentials-flow
*/
private void refreshAccessToken() {
if (credentials.getSpotifyId().isEmpty() || credentials.getSpotifySecret().isEmpty()) {
return; //no spotify credentials configured, dont throw unnecessary errors
}
try {
JSONObject jsonClientCredentials = BotController.HTTP.post(URL_SPOTIFY_AUTHENTICATION_HOST + "/api/token",
Http.Params.of(
Expand Down

0 comments on commit 601bfbe

Please sign in to comment.