First big update in over 5 months :P Though you may have noticed many minor changes since then; I still very much keep an eye on Gamocosm even when I’m not actively developing new features (apparently, once every half year now :P ).

I believe it was requested before early on, but now feeling comfortable with the status of Gamocosm (it’s been mostly stable for the past many months, as far as I know xD ), I decided to pick this feature up, as requested almost 2 months ago on GitHub (link). I had school and persistent real life issues which kept delaying progress, but finally I sat down and cranked the rest of it out. There’s now a “Schedule” tab where you can set different times of the week to start/stop your server. Also, you can choose the autoshutdown duration now.

The schedule is still in beta!

I actually did quite some manual testing of specific parts, and wrote unit tests for as much as I good, but it hasn’t been tested live yet! I’ll be doing some myself the next few days, but if you try it out please be patient if it breaks, and it’d be greatly appreciated if you would report any issues on GitHub. Thanks!

What is

I believe there are better instructions under the “Schedule” tab for a server (where you actually set it up), but here I’ll try to explain what it is. The schedule is based on a week - so you can have it start/stop every Monday/Tuesday/Wednesday/etc. It’s also limited to 30 minute intervals currently - though it should be a quick change to change that in the future, though there are some technical limitations - which I’ll explain below. You specify “rules” on each line, where a rule is [day of week] [hour]:[minute] [am or pm] [start or stop]. You can have a server start at a certain time, then let autoshutdown stop it.

Implementation details

I posted some thoughts in the GitHub issue, but basically I went with a single, periodic background worker + limitted intervals. Here’s the diff.

Based on the day of week, hour, and minute (currently limitted to 0 or 30), an integer “partition” is calculated. When the periodic background worker runs, it figures out the current partition. This way, it can look up all the tasks it should be running for the current chunk of time.

The benefit of this approach is that there isn’t any intermediate state. If each server had background workers for all their scheduled tasks, and at arbitrary times, it would get particularly messy trying to figure out what to do when the user updates the schedule. It’s not hard to change the partition interval to, say 15 minutes. I think Sidekiq (what Gamocosm uses for background tasks) is pretty accurate, and I know it’s very efficient, but I gave partitions a 5 minute buffer currently (if it’s 5:55 it’ll get all the jobs for 6:00). Shortening the time interval below 10 minutes may cause some issues, but I doubt that’s neccessary. Maybe 30 minutes is too big; maybe people would like to start their servers at 5:55 so it’s up by 6 instead of starting at 6. I don’t know how people are using it (my play time is erratic so I just start my servers when I’m ready), so let me know if you have any feedback!

PS: maybe the writing in this post sucks, I’m sorry :S Tired, but really wanted to get this out since I’m happy about it. Maybe in the future I’ll tidy it up/someone will ask for clarification on something