Skip to content

Commit cb527d5

Browse files
committed
CHANGES:
- Cron Service: reboot can reset maintenance flags now
1 parent 54e2bc1 commit cb527d5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

services/cron/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ DEFAULT:
7878
rotate: true # Optional: rotate to the next mission
7979
shutdown: true # Optional: shutdown the DCS server
8080
reboot: true # Optional: reboot the PC (shutdown /r)
81+
maintenance: false # Optional: reset any maintenance flag to false
8182
```
8283
8384
c) halt

services/cron/actions/default.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def report(file: str, channel: int, node: Node, persistent: bool | None =
2929

3030
async def restart(node: Node, server: Server | None = None, shutdown: bool | None = False,
3131
rotate: bool | None = False, run_extensions: bool | None = True,
32-
reboot: bool | None = False):
32+
reboot: bool | None = False, maintenance: bool | None = None):
3333
def _reboot():
3434
os.system("shutdown /r /t 1")
3535

@@ -44,14 +44,16 @@ def _reboot():
4444
await server.loadNextMission(modify_mission=run_extensions)
4545
else:
4646
await server.restart(modify_mission=run_extensions)
47-
server.maintenance = False
47+
server.maintenance = maintenance
4848
elif reboot:
4949
bus = ServiceRegistry.get(ServiceBus)
5050
for server in [x for x in bus.servers.values() if x.status not in [Status.SHUTDOWN, Status.UNREGISTERED]]:
5151
if not server.is_remote:
5252
await bus.send_to_node({"command": "onShutdown", "server_name": server.name})
5353
await asyncio.sleep(1)
5454
await server.shutdown()
55+
if maintenance is not None:
56+
server.maintenance = maintenance
5557
atexit.register(_reboot)
5658
await node.shutdown()
5759

0 commit comments

Comments
 (0)