LeagueOfPoro / CapsuleFarmerEvolved

Automatically drops from lolesports.com and farm Esports Capsules
Other
813 stars 128 forks source link

fix: changed from datetime to monotonic for more reliable timestamp #181

Closed rektile closed 1 year ago

rektile commented 1 year ago

Fixes #180

Summary of Changes

I changed the time format used for checking if a new drop has occurred. This is because datetime.now().timestamp() generates a timestamp based on the current system time reported by the system clock, which can be inaccurate if something happens with that clock. Instead, I used time.monotonic(), which is based on a monotonic clock that provides a consistent measure of time. I'm not sure if this will fix the bug that some people have reported, but it is generally a better way to do this.

Additional context

Discord username (if different from GitHub): Rektile#7582

Testing instructions

Check if session drops go up. Hard to check because not everyone has the bug.

How to download the PR for testing

Using GitHub CLI

  1. Clone this PR
  2. Run gh pr checkout 181 (Requires GitHub CLI)
  3. Follow the Advanced Installation Guides from the Wiki

Using regular GIT

  1. Fetch the PR git fetch origin pull/<PR_NUMBER>/head:<LOCAL_BRANCH_NAME> (e.g. git fetch origin pull/110/head:notif)
  2. Checkout the branch git checkout <LOCAL_BRANCH_NAME> (e.g. git checkout notif)
  3. Follow the Advanced Installation Guides from the Wiki
rektile commented 1 year ago

I noticed this will not work when checking with the timers from riot.