Skip to content

Commit

Permalink
Moves inter-round caches to cache/. Deletes tmp/ between rounds. Keep…
Browse files Browse the repository at this point in the history
…s tts from killing servers. (tgstation#81433)
  • Loading branch information
MrStonedOne authored Feb 13, 2024
1 parent 90f03af commit 9ddfd4a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
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 @@ -532,9 +532,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

0 comments on commit 9ddfd4a

Please sign in to comment.