Skip to content

Commit 0c3ddff

Browse files
committed
tweak(core): renamed restarter.bootCooldown to bootGracePeriod
1 parent 5c22611 commit 0c3ddff

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

core/modules/ConfigStore/schema/oldConfig.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const restructureOldConfig = (old: any) => {
5050
},
5151
restarter: {
5252
schedule: old?.monitor?.restarterSchedule, //NOTE:renamed
53-
bootCooldown: old?.monitor?.cooldown, //NOTE:renamed
53+
bootGracePeriod: old?.monitor?.cooldown, //NOTE:renamed
5454
resourceStartingTolerance: old?.monitor?.resourceStartingTolerance,
5555
},
5656
banlist: { //NOTE: All Renamed
@@ -92,8 +92,8 @@ export const migrateOldConfig = (old: any) => {
9292
const remapped = restructureOldConfig(old) as any;
9393

9494
//Some migrations before comparing because defaults changed
95-
if (typeof remapped.restarter?.bootCooldown === 'number') {
96-
remapped.restarter.bootCooldown = Math.round(remapped.restarter.bootCooldown);
95+
if (typeof remapped.restarter?.bootGracePeriod === 'number') {
96+
remapped.restarter.bootGracePeriod = Math.round(remapped.restarter.bootGracePeriod);
9797
}
9898
if (typeof remapped.server?.shutdownNoticeDelayMs === 'number') {
9999
remapped.server.shutdownNoticeDelayMs *= 1000;

core/modules/ConfigStore/schema/restarter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const schedule = typeDefinedConfig({
1717
},
1818
});
1919

20-
const bootCooldown = typeDefinedConfig({
21-
name: 'Boot Cooldown',
20+
const bootGracePeriod = typeDefinedConfig({
21+
name: 'Boot Grace Period',
2222
default: 15,
2323
validator: z.number().int().min(15),
2424
fixer: SYM_FIXER_DEFAULT,
@@ -34,6 +34,6 @@ const resourceStartingTolerance = typeDefinedConfig({
3434

3535
export default {
3636
schedule,
37-
bootCooldown,
37+
bootGracePeriod,
3838
resourceStartingTolerance,
3939
} as const;

core/modules/FxMonitor/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ export default class FxMonitor {
237237
this.setCurrentStatus(currentStatusString);
238238

239239
//Check if still in cooldown
240-
if (processUptime < txConfig.restarter.bootCooldown) {
240+
if (processUptime < txConfig.restarter.bootGracePeriod) {
241241
if (console.isVerbose && processUptime > 10 && this.swLastStatusWarning.isOver(10)) {
242-
console.warn(`${timesPrefix} FXServer status is ${currentStatusString}. Still in cooldown of ${txConfig.restarter.bootCooldown}s.`);
242+
console.warn(`${timesPrefix} FXServer status is ${currentStatusString}. Still in cooldown of ${txConfig.restarter.bootGracePeriod}s.`);
243243
this.swLastStatusWarning.restart();
244244
}
245245
return;

core/modules/FxScheduler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export default class FxScheduler {
264264

265265
//Check if server is in boot cooldown
266266
const processUptime = Math.floor((txCore.fxRunner.child?.uptime ?? 0) / 1000);
267-
if (processUptime < txConfig.restarter.bootCooldown) {
267+
if (processUptime < txConfig.restarter.bootGracePeriod) {
268268
console.verbose.log(`Server is in boot cooldown, skipping scheduled restart.`);
269269
return;
270270
}

panel/src/pages/Settings/tabCards/_template.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default function SettingsCardTemplate({ cardCtx, pageCtx }: SettingsCardP
5757
const inputArrayRef = useRef<HTMLInputElement | null>(null);
5858
const nullableInput = conf('server', 'dataPath');
5959
const nullableInputRef = useRef<HTMLInputElement | null>(null);
60-
const customComponent = conf('restarter', 'bootCooldown');
60+
const customComponent = conf('restarter', 'bootGracePeriod');
6161
const bigRadio = conf('whitelist', 'mode');
6262

6363
//Marshalling Utils

0 commit comments

Comments
 (0)