MDL-80862 core: Tidy up state vars in task manager

This commit is contained in:
Andrew Nicols
2024-02-20 12:44:58 +08:00
parent becd11a84a
commit 8ebd9f08e4
2 changed files with 10 additions and 6 deletions
+6 -6
View File
@@ -63,24 +63,24 @@ class manager {
/**
* @var array A cached queue of adhoc tasks
*/
public static $miniqueue;
protected static array $miniqueue = [];
/**
* @var int The last recorded number of unique adhoc tasks.
*/
public static $numtasks;
protected static int $numtasks = 0;
/**
* @var string Used to determine if the adhoc task queue is distributing or filling capacity.
* @var null|int Used to determine if the adhoc task queue is distributing or filling capacity.
*/
public static $mode;
protected static ?int $mode = null;
/**
* Reset the state of the task manager.
*/
public static function reset_state(): void {
self::$miniqueue = null;
self::$numtasks = null;
self::$miniqueue = [];
self::$numtasks = 0;
self::$mode = null;
}