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

Improved User & State Handling #94

Open
Kaiede opened this issue May 31, 2024 · 2 comments
Open

Improved User & State Handling #94

Kaiede opened this issue May 31, 2024 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@Kaiede
Copy link
Owner

Kaiede commented May 31, 2024

First, the backup service assumes that there is nobody logged in when it connects to the server console. It should issue a command to list the players as it connects so it is in sync with the server state. Also, we don’t record any information about state between runs, which means we are limited in the type of logic that can be used to decide when to backup or not.

With the extra reliability of knowing when players are actually active on the server, this can be used to limit the number of backups made. For example, the below configuration would check if it should do a backup every hour, but would only backup if:

  • A backup hadn’t already been made in the last 3 hours.
  • A user had been logged in at some point since the last backup.
schedule:
  interval: 1h
  minInterval: 3h
  requireActivity: true

A configuration such as this would mean that at most, one would lose about 3 hours of work, but backups won’t be made during downtime when nobody has been playing. A simpler solution that just backs up every hour, but only if players are active could look like this:

schedule:
  interval: 1h
  requireActivity: true

The drawback being that while you are getting more frequent backups and will lose less work, you can get “spikes” on days where there’s a lot of activity. Some days getting 3 backups, others getting 24. So users would need to account for the sort of ‘worst-case’ scenario of heavy usage days in their configuration.

@Kaiede Kaiede added the enhancement New feature or request label May 31, 2024
@Kaiede Kaiede added this to the 1.3 milestone May 31, 2024
@Kaiede
Copy link
Owner Author

Kaiede commented May 31, 2024

A good chunk of this applies to the interval based backups. Under the current model, if you are using something like this:

schedule:
  daily: 01:00
  onLastLogout: true
  minInterval: 1h

You are already getting something quite like the above, however it doesn’t let you capture snapshots during active play. So it’s possible to lose quite a bit of time.

On this front, something like this would be interesting:

schedule:
  onLastLogout: true
  interval: 1h
  minInterval: 1h
  requireActivity: true
  limitEventsSeparately: true

This would mean the last logout triggers a backup, even in the face of the hourly interval backups. But then the event backups would be limited to once an hour separately.

@Kaiede
Copy link
Owner Author

Kaiede commented May 31, 2024

  • requireActivity - Only run interval backups if a user was logged in.
  • limitEventsSeparately - Tell the service to monitor event intervals separately.
  • minEventInterval - Used when limitEventsSeparately is true, instead of minInterval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant