Skip to content

Commit

Permalink
Add more logging while archiving
Browse files Browse the repository at this point in the history
  • Loading branch information
randomnetcat committed Mar 22, 2024
1 parent b2a6e64 commit c07175a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/kotlin/org/randomcat/agorabot/commands/Archive.kt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class ArchiveCommand(

path.copyToRecursively(localStorageDir.resolve(fileName), followLinks = false)
respond("Stored archive locally at $fileName")
LOGGER.info("Stored archive of guild ${currentGuild.id} (${currentGuild.name}) at $fileName")
}
} else {
TODO("uploading not supported")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,8 @@ class DefaultDiscordArchiver(
guild: Guild,
channelIds: Set<String>,
): Path {
logger.info("Beginning archive of guild ${guild.id} (${guild.name})")

val archiveNumber = archiveCount.getAndUpdate { it + BigInteger.ONE }

val workDir = storageDir.resolve("archive-$archiveNumber").createDirectory()
Expand All @@ -1014,6 +1016,8 @@ class DefaultDiscordArchiver(
)
}

logger.info("Finished archive of guild ${guild.id} (${guild.name})")

return workDir
}

Expand Down

0 comments on commit c07175a

Please sign in to comment.