serverwatcher 4.7__tar.gz → 4.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {serverwatcher-4.7/src/serverwatcher.egg-info → serverwatcher-4.7.1}/PKG-INFO +1 -1
- {serverwatcher-4.7 → serverwatcher-4.7.1}/pyproject.toml +1 -1
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher/configclasses/messages.py +2 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher/defaultconfigs/messages.yaml +1 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher/defaultconfigs/watcher.yaml +1 -1
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher/watcher.py +7 -20
- {serverwatcher-4.7 → serverwatcher-4.7.1/src/serverwatcher.egg-info}/PKG-INFO +1 -1
- {serverwatcher-4.7 → serverwatcher-4.7.1}/LICENSE +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/README.md +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/setup.cfg +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher/__init__.py +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher/configclasses/__init__.py +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher/configclasses/global_config.py +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher/configclasses/watcher.py +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher/defaultconfigs/global.yaml +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher/validator.py +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher.egg-info/SOURCES.txt +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher.egg-info/dependency_links.txt +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher.egg-info/requires.txt +0 -0
- {serverwatcher-4.7 → serverwatcher-4.7.1}/src/serverwatcher.egg-info/top_level.txt +0 -0
|
@@ -118,9 +118,7 @@ class ServerWatcher:
|
|
|
118
118
|
local_time = scheduled.astimezone(self.tz)
|
|
119
119
|
time_str = local_time.strftime("%I:%M %p")
|
|
120
120
|
|
|
121
|
-
self.server.sendBroadcast(
|
|
122
|
-
self.fmt(self.messages.broadcast_restart_at, time=time_str)
|
|
123
|
-
)
|
|
121
|
+
self.server.sendBroadcast(self.fmt(self.messages.broadcast_restart_at, time=time_str))
|
|
124
122
|
|
|
125
123
|
# minute_* callbacks
|
|
126
124
|
minute_callbacks = {
|
|
@@ -170,15 +168,11 @@ class ServerWatcher:
|
|
|
170
168
|
pro += self.cfg.weight_restart_soon
|
|
171
169
|
|
|
172
170
|
if snap.ram >= self.cfg.ram_threshold:
|
|
173
|
-
restart_reasons.append(
|
|
174
|
-
self.fmt(self.messages.reason_ram, ram=snap.ram, threshold=self.cfg.ram_threshold)
|
|
175
|
-
)
|
|
171
|
+
restart_reasons.append(self.fmt(self.messages.reason_ram, ram=snap.ram, threshold=self.cfg.ram_threshold))
|
|
176
172
|
pro += int(round(snap.ram, 0) - (self.cfg.ram_threshold - 1))
|
|
177
173
|
|
|
178
174
|
if snap.cpu >= self.cfg.cpu_threshold:
|
|
179
|
-
restart_reasons.append(
|
|
180
|
-
self.fmt(self.messages.reason_cpu, cpu=snap.cpu, threshold=self.cfg.cpu_threshold)
|
|
181
|
-
)
|
|
175
|
+
restart_reasons.append(self.fmt(self.messages.reason_cpu, cpu=snap.cpu, threshold=self.cfg.cpu_threshold))
|
|
182
176
|
pro += self.cfg.weight_cpu
|
|
183
177
|
|
|
184
178
|
if snap.uptime // 3600 >= self.cfg.uptime_hours_threshold:
|
|
@@ -189,24 +183,18 @@ class ServerWatcher:
|
|
|
189
183
|
pro += self.cfg.weight_uptime
|
|
190
184
|
|
|
191
185
|
if (snap.tps if snap.tps is not None else 0) <= self.cfg.tps_threshold:
|
|
192
|
-
restart_reasons.append(
|
|
193
|
-
self.fmt(self.messages.reason_tps, tps=snap.tps, threshold=self.cfg.tps_threshold)
|
|
194
|
-
)
|
|
186
|
+
restart_reasons.append(self.fmt(self.messages.reason_tps, tps=snap.tps, threshold=self.cfg.tps_threshold))
|
|
195
187
|
pro += self.cfg.weight_tps
|
|
196
188
|
|
|
197
189
|
# anti-restart
|
|
198
190
|
if snap.uptime // 60 < 30:
|
|
199
|
-
no_restart_reasons.append(
|
|
200
|
-
self.fmt(self.messages.reason_low_uptime, uptime=snap.uptime_formatted)
|
|
201
|
-
)
|
|
191
|
+
no_restart_reasons.append(self.fmt(self.messages.reason_low_uptime, uptime=snap.uptime_formatted))
|
|
202
192
|
anti += self.cfg.weight_low_uptime
|
|
203
193
|
|
|
204
194
|
if snap.players > 0:
|
|
205
195
|
verb = "are" if snap.players != 1 else "is"
|
|
206
196
|
plural = "players" if snap.players != 1 else "player"
|
|
207
|
-
no_restart_reasons.append(
|
|
208
|
-
self.fmt(self.messages.reason_players, verb=verb, count=snap.players, plural=plural)
|
|
209
|
-
)
|
|
197
|
+
no_restart_reasons.append(self.fmt(self.messages.reason_players, verb=verb, count=snap.players, plural=plural))
|
|
210
198
|
anti += snap.players * self.cfg.weight_per_player
|
|
211
199
|
|
|
212
200
|
# logging
|
|
@@ -219,7 +207,7 @@ class ServerWatcher:
|
|
|
219
207
|
if no_restart_reasons:
|
|
220
208
|
self.log.warn(f"{self.messages.anti_restart_splash}")
|
|
221
209
|
for r in no_restart_reasons:
|
|
222
|
-
self.log.warn(f"
|
|
210
|
+
self.log.warn(f"{self.messages.bullet} {r}")
|
|
223
211
|
self.log.warn("\n")
|
|
224
212
|
|
|
225
213
|
self.log.warn(f"Pro-restart: {pro}")
|
|
@@ -242,7 +230,6 @@ class ServerWatcher:
|
|
|
242
230
|
if gap <= 2:
|
|
243
231
|
self.log.warn(self.fmt(self.messages.log_gap_low, gap=gap))
|
|
244
232
|
self.schedule_restart(self.cfg.low_gap_minutes)
|
|
245
|
-
else:
|
|
246
233
|
self.log.warn(self.fmt(self.messages.log_gap_high, gap=gap))
|
|
247
234
|
self.schedule_restart(self.cfg.high_gap_minutes)
|
|
248
235
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|