mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Refuse to handle Resart() when in --no-restart mode
While AutoRestart property in the config is a hint for ASF what it should be doing, --no-restart cmd-line argument is used in scripts and environments that must directly monitor the process, e.g. Docker. In such environments, we should refuse a call to Restart() action, as it's never feasible.
This commit is contained in:
@@ -248,6 +248,10 @@ namespace ArchiSteamFarm.Steam.Interaction {
|
||||
|
||||
[PublicAPI]
|
||||
public static (bool Success, string Message) Restart() {
|
||||
if (!Program.RestartAllowed) {
|
||||
return (false, "!" + nameof(Program.RestartAllowed));
|
||||
}
|
||||
|
||||
// Schedule the task after some time so user can receive response
|
||||
Utilities.InBackground(
|
||||
async () => {
|
||||
|
||||
Reference in New Issue
Block a user