torikushiii / hoyolab-auto

Auto check-in and others for any Hoyoverse games
https://ko-fi.com/torikushiii
GNU Affero General Public License v3.0
110 stars 24 forks source link

[ZZZ/GI] Cache values for stamina problem #49

Closed YozenPL closed 3 months ago

YozenPL commented 3 months ago

Hello,

I'm using the cache values for my external display and I saw something strange. I'll use ZZZ as example. I set the threshold for 230/240. When I reach the 230 I'm receiving a notification via webhook (+SMS via REST from my script which is reading the cache). I'm login to the game and use my stamina. Let's say I decreased it to 100. Cache value is still showing the 230 (even after 3 hours - I know because I'm getting the 1 SMS per hour for it) until I restart the hoyolab-auto. Could you please look at it?

YozenPL commented 3 months ago

the original cache.js as of this commit? dbfd65d

Yes and everything doesn't get updated only after ZZZ threshold got reached and ZZZ data is static until next restart? If so, I'm just gonna put another check at stamina cron

Yes it is static but restart only does not help, I need to use stamina and restart.

torikushiii commented 3 months ago

I think I figured something out, can you try this commit now https://github.com/torikushiii/hoyolab-auto/commit/08d3cd56f2609ae7eb913e346e981d8cd0d9b310

I've successfully able to replicate the stamina not gaining properly issue but not the ZZZ one (but i hope this solve it too).

Forgot to tell you, but you'll need to delete the cache.json file again since this new commit will break the old cache

YozenPL commented 3 months ago

No luck.

  1. Current stamina 82.
  2. Threshold set to 60.
  3. Cache deleted
  4. git pull
  5. npm start
  6. New data appeared (even ZZZ), notification was sent, but ZZZ local count does not work and refreshment every hour also does not work.
torikushiii commented 3 months ago

for every platform or just ZZZ?

YozenPL commented 3 months ago

Only ZZZ.

torikushiii commented 3 months ago

I'm a certified idiot.

There's a bug at the crons which does not fetch the stamina properly and just stuck there infinitely after firing a notification (just like what you said) if you didnt enable a specific config setting. Latest commit SHOULD fix this. If it is I'm sorry for wasting your time by testing this useless stuff 🙃

YozenPL commented 3 months ago

obraz It's working. Thank you!