Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow skipping autopause/autostop using a file #2261

Merged
merged 3 commits into from
Jun 30, 2023

Conversation

Steveplays28
Copy link
Contributor

I've added a check to the autopause/autostop daemons to see if the /data/.skip-pause (/data/.skip-stop for autostop) file is present, and if so, prevent autopausing/autostopping.

I've also added notes about this to the docs.

Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Theme of my comments is "keep it simple" 😀.

files/auto/autopause-daemon.sh Outdated Show resolved Hide resolved
files/auto/autopause-daemon.sh Outdated Show resolved Hide resolved
files/auto/autopause-daemon.sh Outdated Show resolved Hide resolved
Also removed the knock timer reset, as per the suggestion in the review.
@Steveplays28
Copy link
Contributor Author

I implemented your suggestions, and added some brackets and fi statements I missed.
Let me know if anything else needs changing!

@Steveplays28 Steveplays28 changed the title Allow skipping autopause using a file Allow skipping autopause/autostop using a file Jun 29, 2023
Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I was wondering if you have been able to test the changes?

files/auto/autostop-daemon.sh Outdated Show resolved Hide resolved
files/auto/autopause-daemon.sh Show resolved Hide resolved
@Steveplays28
Copy link
Contributor Author

Steveplays28 commented Jun 30, 2023

At the moment I haven't tested this yet. I can try cloning it onto my homeserver and see if it works.
It'll probably take quite a while to build though.

EDIT: wasn't as bad as I thought. It seems to be posting a log message every 5 ish seconds though:
image

And it seems like the text isn't quite correct, let me fix that.
Not sure what/if I should do anything about the log message being repeated. Maybe something with the states?
I'll incorporate your review's suggestions first and see if the issue is still present then.

@Steveplays28
Copy link
Contributor Author

Steveplays28 commented Jun 30, 2023

After the latest commit it now looks like this:
image

The log message is being sent every 10 seconds or so.
It does still go between saying skipping pausing and clients disconnected, pausing in 1200 seconds, which seems a little confusing to me.

Maybe the server should go into stopped state once the check in knocked state detects the file, and the log message shouldn't be printed on init, instead only checking if the other pausing message should be sent. Then the log wouldn't be spammed and the message wouldn't be posted twice on startup.

@itzg
Copy link
Owner

itzg commented Jun 30, 2023

Test failures were upstream Modrinth 500 errors, so this is good to merge.

@itzg itzg merged commit 4a942db into itzg:master Jun 30, 2023
@Steveplays28
Copy link
Contributor Author

Alright, thanks for the reviews and merge!

@Steveplays28 Steveplays28 deleted the skip-pause branch June 30, 2023 16:10
adamancini pushed a commit to adamancini/docker-minecraft-server that referenced this pull request Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants