Ports #59750 from TG: Adds configs to disable hard deletes (#11622)

* Adds configs to disable hard deletes

* Apply suggestions from code review

Co-authored-by: Jordan Brown <Cyberboss@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: MrStonedOne <kyleshome@gmail.com>
Co-authored-by: Jordan Brown <Cyberboss@users.noreply.github.com>
Co-authored-by: Jamie D <993128+JamieD1@users.noreply.github.com>
This commit is contained in:
alexkar598
2021-06-26 07:12:06 -04:00
committed by GitHub
parent 77aa205e6b
commit 1c611b9cff
3 changed files with 15 additions and 4 deletions

View File

@@ -500,3 +500,7 @@
/datum/config_entry/string/centcom_ban_db // URL for the CentCom Galactic Ban DB API
/datum/config_entry/flag/auto_profile
/datum/config_entry/flag/disable_gc_failure_hard_deletes
/datum/config_entry/flag/disable_all_hard_deletes

View File

@@ -162,6 +162,7 @@ SUBSYSTEM_DEF(garbage)
testing("GC: -- \ref[src] | [type] was unable to be GC'd --")
I.failures++
if (GC_QUEUE_HARDDELETE)
if (!CONFIG_GET(flag/disable_gc_failure_hard_deletes))
HardDelete(D)
if (MC_TICK_CHECK)
return
@@ -200,7 +201,7 @@ SUBSYSTEM_DEF(garbage)
++totaldels
var/type = D.type
var/refID = "\ref[D]"
if (!CONFIG_GET(flag/disable_all_hard_deletes))
del(D)
tick = (TICK_USAGE-tick+((world.time-ticktime)/world.tick_lag*100))

View File

@@ -436,3 +436,9 @@ DEFAULT_VIEW_SQUARE 15x15
CENTCOM_BAN_DB https://centcom.melonmesa.com/ban/search
AUTO_PROFILE
## Uncomment to disable hard deleting garbage collection failures. (Hard deleting GC failures causes lag in order to bring memory usage down and keep bugged objects from hanging around and causing bugs in other things.) You can safely enable this for performance on production if the lag spikes are too disruptive)
#DISABLE_GC_FAILURE_HARD_DELETES
## Uncomment to disable hard deletes entirely, even things that explicitly request. This is not recommended unless you have a need for it during events or other high pop times where performance is key.
#DISABLE_ALL_HARD_DELETES