mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Merge pull request #40417 from tgstation/MrStonedOne-patch-1
Makes timer watchdog logic Fitter, Happier, More Productive
This commit is contained in:
committed by
yogstation13-bot
parent
81a1280956
commit
dde29c364f
@@ -22,8 +22,6 @@
|
||||
//In most cases you want a subsystem instead
|
||||
#define TIMER_LOOP (1<<5)
|
||||
|
||||
#define TIMER_NO_INVOKE_WARNING 600 //number of byond ticks that are allowed to pass before the timer subsystem thinks it hung on something
|
||||
|
||||
#define TIMER_ID_NULL -1
|
||||
|
||||
//For servers that can't do with any additional lag, set this to none in flightpacks.dm in subsystem/processing.
|
||||
|
||||
@@ -38,15 +38,15 @@ SUBSYSTEM_DEF(timer)
|
||||
|
||||
/datum/controller/subsystem/timer/fire(resumed = FALSE)
|
||||
var/lit = last_invoke_tick
|
||||
var/last_check = world.time - TIMER_NO_INVOKE_WARNING
|
||||
var/last_check = world.time - TICKS2DS(BUCKET_LEN*1.5)
|
||||
var/list/bucket_list = src.bucket_list
|
||||
|
||||
if(!bucket_count)
|
||||
last_invoke_tick = world.time
|
||||
|
||||
if(lit && lit < last_check && last_invoke_warning < last_check)
|
||||
if(lit && lit < last_check && head_offset < last_check && last_invoke_warning < last_check)
|
||||
last_invoke_warning = world.time
|
||||
var/msg = "No regular timers processed in the last [TIMER_NO_INVOKE_WARNING] ticks[bucket_auto_reset ? ", resetting buckets" : ""]!"
|
||||
var/msg = "No regular timers processed in the last [BUCKET_LEN*1.5] ticks[bucket_auto_reset ? ", resetting buckets" : ""]!"
|
||||
message_admins(msg)
|
||||
WARNING(msg)
|
||||
if(bucket_auto_reset)
|
||||
|
||||
Reference in New Issue
Block a user