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

rysnc the pinned directory on deploy, clean unused pins in queue #10071

Merged
merged 3 commits into from
Dec 31, 2023

Conversation

michaeljb
Copy link
Collaborator

  • rsync public/pinned on deployment so the current release always shows up in pins directory, simplifying the process to pin games
  • clean up unused pin files daily in queue.rb * keep the newest few around so that just-deployed pins aren't cleaned up before they can be used

* rsync `public/pinned` on deployment so the current release always shows up in
  pins directory, simplifying the process to pin games
* clean up unused pin files daily in `queue.rb`
    * keep the newest few around so that just-deployed pins aren't cleaned up
      before they can be used
queue.rb Outdated
@@ -21,6 +24,8 @@

scheduler = Rufus::Scheduler.new

PINS_TO_KEEP = 3
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn’t you keep all pins that are still being played?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This constant ensures the latest pins are kept even if they're not used, otherwise all unused pins are discarded. I've added a comment and updated the constant name to clarify this.

Copy link
Owner

@tobymao tobymao left a comment

Choose a reason for hiding this comment

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

i don’t think we need to keep any pins that aren’t used

@michaeljb
Copy link
Collaborator Author

When a new release is deployed, that pin file won't be used at all, it might not be used till the next release.

If you have some games that need to be pinned to release A when you deploy release B, but you don't pin until after deploying B, there will be a small window where neither A nor B is used at all but you don't want either of them cleaned up, so I think keeping 2 around makes sense.

I set it to 3 as a fallback in case a game needs to be pinned to a version other than the latest, but cases where that happens and we can find the right version are probably rare enough that it's fine to do rebuild and deploy the pin when it does happen. I'll change the constant value down to 2.

@michaeljb michaeljb merged commit 8194301 into tobymao:master Dec 31, 2023
1 check passed
@michaeljb michaeljb deleted the rsync-pinned branch December 31, 2023 21:55
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