Skip to content

Commit

Permalink
Use env vars everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Jan 31, 2025
1 parent e120373 commit 56cbb77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/net/neoforged/waifu/ModIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.concurrent.ExecutorService;

public class ModIndexer<T extends IndexDatabase.DatabaseMod> {
private static final boolean KEEP_CACHES = Boolean.parseBoolean(System.getenv().getOrDefault("KEEP_PLATFORM_CACHES", "true")));
private final Path baseCacheFolder;
private final IndexDatabase<T> db;

Expand Down Expand Up @@ -233,7 +234,7 @@ public synchronized void addFile(PlatformModFile file) throws IOException {
var mod = ModFileInfo.read(
new ModFilePath(
FileSystems.newFileSystem(path).getRootDirectories().iterator().next(),
file.getHash(), null
file.getHash(), KEEP_CACHES ? null : path
),
null, null
);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/neoforged/waifu/discord/DiscordBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public DiscordBot(String token, MainDatabase database) throws InterruptedExcepti
.build();
jda.awaitReady();

channelId = Long.parseLong(System.getProperty("discord.channel.id"));
channelId = Long.parseLong(System.getenv("DISCORD_CHANNEL_ID"));
messageUpdateService = Executors.newScheduledThreadPool(3, Thread.ofVirtual().name("discord-update-service-", 0).factory());
}

Expand Down

0 comments on commit 56cbb77

Please # to comment.