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

[MIRROR] Moves inter-round caches to cache/. Deletes tmp/ between rounds. Keeps tts from killing servers. #1978

Merged
merged 1 commit into from
Feb 15, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#Ignore everything in datafolder and subdirectories
/data/**/*
/tmp/**/*
/cache/**/*

#Ignore byond config folder.
/cfg/**/*
Expand Down
5 changes: 5 additions & 0 deletions code/controllers/subsystem/server_maint.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ SUBSYSTEM_DEF(server_maint)
world.hub_password = "" //quickly! before the hubbies see us.

/datum/controller/subsystem/server_maint/Initialize()
if (fexists("tmp/"))
fdel("tmp/")

if (CONFIG_GET(flag/hub))
world.update_hub_visibility(TRUE)
//Keep in mind, because of how delay works adding a list here makes each list take wait * delay more time to clear
Expand Down Expand Up @@ -82,6 +85,8 @@ SUBSYSTEM_DEF(server_maint)
return

/datum/controller/subsystem/server_maint/Shutdown()
if (fexists("tmp/"))
fdel("tmp/")
kick_clients_in_lobby(span_boldannounce("The round came to an end with you in the lobby."), TRUE) //second parameter ensures only afk clients are kicked
var/server = CONFIG_GET(string/server)
for(var/thing in GLOB.clients)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/asset_cache/asset_list.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define ASSET_CROSS_ROUND_CACHE_DIRECTORY "tmp/assets"
#define ASSET_CROSS_ROUND_CACHE_DIRECTORY "cache/assets"

//These datums are used to populate the asset cache, the proc "register()" does this.
//Place any asset datums you create in asset_list_items.dm
Expand Down
4 changes: 2 additions & 2 deletions config/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,9 @@ URGENT_AHELP_COOLDOWN 300
MOTD motd.txt
#MOTD motd_extra.txt

## Assets can opt-in to caching their results into `tmp`.
## Assets can opt-in to caching their results into `cache/`.
## This is important, as preferences assets take upwards of 30 seconds (without sleeps) to collect.
## The cache is assumed to be cleared by TGS recompiling, which deletes `tmp`.
## The cache is assumed to be cleared by TGS recompiling, which deletes `cache/`.
## This should be disabled (through `CACHE_ASSETS 0`) on development,
## but enabled on production (the default).
CACHE_ASSETS 0
Expand Down
Loading