Repository navigation
Deleted Field Fix and Force Potentially Deleted Worlds Offline - #160
Merged
Merged
Conversation
Contributor
|
Light Goob Tree Miner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the bug where worlds are never set to deleted even if they haven't been scraped for 24hrs. I believe it was because the only worlds being checked where ones that had just been scraped, and so no outdated ones were caught.
It also sets worlds that have not been scraped for 6 hours to be offline with a player count of 0. The reason for the latter is that it stops deleted worlds from appearing active and being amongst worlds that are actually online, such as on the browse page https://legiti.dev/browse.
Deleted field and setting worlds to offline:
After each 10th scrape (approximately 30 minutes),
Scraper#markDeletedWorldsis now called, which finds and marks all worlds that haven't been scraped for 24Hrs or more as deleted and offline. Worlds that have not been scraped for 6 hours are set to offline (including having their player count set to 0).There is a new constant (
UNLOCK_TIME_MILLIS) for the latter.Other changes:
Both calls to
closeContainerinScrapernow do so on the render thread (or client thread?), which I believe has removed the warnings about calling it from a different one.There is a new method
isConnectedinDatabasewhich returns whether the mongo database is set up and working. This is checked before each scrape. I believe has fixed the client freezing when joining a server without mongodb running.Tested:
I've quite thoroughly tested the changes locally so I'm quite confident everything works.