Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cleanup and oldlogs saving respect silentstartup #1714

Merged
merged 2 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions MainModule/Server/Core/Logs.luau
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,15 @@ return function(Vargs, GetEnv)
--// Disable saving command logs in Studio; not required.
if service.RunService:IsStudio() or service.RunService:IsRunMode() then
return
elseif not server.Data or not server.Data.SilentStartup then
print("Saving command logs...")
end

print("Saving command logs...")

if Settings.SaveCommandLogs ~= true or Settings.DataStoreEnabled ~= true then
print("Skipped saving command logs.")
if not server.Data or not server.Data.SilentStartup then
print("Skipped saving command logs.")
end

return
end

Expand Down Expand Up @@ -175,7 +178,9 @@ return function(Vargs, GetEnv)
return service.HttpService:JSONEncode(temp)
end)

print("Command logs saved!")
if not server.Data or not server.Data.SilentStartup then
print("Command logs saved!")
end
end;

ListUpdaters = {
Expand Down
9 changes: 7 additions & 2 deletions MainModule/Server/Server.luau
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ local function LoadPackage(package, folder, runNow)
end;

local function CleanUp(reason)
print(`Beginning Adonis cleanup & shutdown process due to {reason}...`)
if not server.Data or not server.Data.SilentStartup then
print(`Beginning Adonis cleanup & shutdown process due to {reason}...`)
end

local data = service.UnWrap(server.Data)
if type(data) == "table" and typeof(service.UnWrap(data.Config)) == "Instance" then
local Settings: ModuleScript = service.UnWrap(data.Config):FindFirstChild("Settings")
Expand Down Expand Up @@ -277,7 +280,9 @@ local function CleanUp(reason)
pcall(server.Core.DisconnectEvent)
end

print("Unloading complete")
if not server.Data or not server.Data.SilentStartup then
print("Unloading complete")
end
end;

server = {
Expand Down
Loading