Issue #49 different variant
Closed this issue · 19 comments
Hello again :D
There are still something not quite right. After every "full hour" hour ZZZ stamina is not fetch from server. I used my stamina (from 240) to 140, somehow at the "full hour" it dropped down to 160 in cache (which was correct). I used some more stamina and during the next full hour I had ~86 but the script is still counting the 160 and it showing 190 now. There are no errors on the console output.
Pseudo flow of events (because I do not write down the stamina numbers at the specific hours):
- 240 stamina used to 140
- Script shown 140 at full hour
- 140 stamina used to 80 and it was ~86 at full hour.
- Script did not read the stamina from API (the ~86) and it is still counting from 160.
- Script shows 190 stamina.
Restart did not helped. I had to remove cache file to make it work.
I think I might know why, can you check the latest commit
Latest commit did not helped. Round hour has passed and it is still counting the previous value instead of fetching the right one via API.
should be fine at the latest commit now, its because the cache lastUpdate
property is being updated so it never expires.
Issue remains. I already used my stamina and I have less than 90. At 20:00 CET it still counting the old value (it is showing 128). It appears that ZZZ and GI are affected.
does the cache file still not update if you leave it at least 1 hour?
I finished playing around around 18:30 so it had at least 2 chances to get the data.
I instinctively deleted cache.json and restarted the application. And it fetched the data correctly.
little mistake at my part, should be fixed now!
Unfortunately no. I used all my stamina at 9:30 CET and it is showing 219 now (11:12 CET).
Not sure what is going on. At round hour (12:00 CET) value in cache changed from 240 to something like 80 (I had ~68 at that time). And now it is not adding 1 stamina per 6 minutes but 8 stamina per X mins. 84 changed to 92 then 100 and now it is showing 108 and it did it in ~30 minutes.
//EDIT: I can confirm it is adding 8 stamina per 5 minutes. I have 116 now.
Could it be related to cron? I set the Stamina to 5mins. I thought it will just refresh the current value every 5 minutes and it seems that it is using this timer to make calculations?
It still does by 8 points per 5 minutes for ZZZ only.
The problem starts after the threshold is reached. Before it, everything is fine.
After successfully replicating all your issue that you described i think i figured something out, this log should update correctly just like what HoYoLab does (hopefully) and the threshold you mentioned recently should be fine since at ZZZ my threshold was set at 220 and it updating correctly now.
Current time: 1724779800817
Last update time: 1724779800043
Seconds since last update: 1
Before stamina update: {
message: '======================================',
uid: '8058-STARRAIL',
rate: 360,
currentStamina: 220.5,
maxStamina: 240,
recoveryTime: 6717,
secondsSinceLastUpdate: 1
}
After stamina update: {
uid: '8058-STARRAIL',
rate: 360,
currentStamina: 220.5,
maxStamina: 240,
recoveryTime: 6716,
message: '======================================'
}
---------------------------------------------------------------------
Current time: 1724779801394
Last update time: 1724779502687
Seconds since last update: 299
Before stamina update: {
message: '======================================',
uid: '1300-ZZZ',
rate: 360,
currentStamina: 221,
maxStamina: 240,
recoveryTime: 6559,
secondsSinceLastUpdate: 299
}
After stamina update: {
uid: '1300-ZZZ',
rate: 360,
currentStamina: 221.83,
maxStamina: 240,
recoveryTime: 6260,
message: '======================================'
}
---------------------------------------------------------------------
Current time: 1724780100030
Last update time: undefined
Seconds since last update: 0
Before stamina update: {
message: '======================================',
uid: '8003-GENSHIN',
rate: 480,
currentStamina: 200,
maxStamina: 200,
recoveryTime: 0,
secondsSinceLastUpdate: 0
}
After stamina update: {
uid: '8003-GENSHIN',
rate: 480,
currentStamina: 200,
maxStamina: 200,
recoveryTime: 0,
message: '======================================'
}
---------------------------------------------------------------------
Current time: 1724780101110
Last update time: 1724779800817
Seconds since last update: 301
Before stamina update: {
message: '======================================',
uid: '8058-STARRAIL',
rate: 360,
currentStamina: 220.5,
maxStamina: 240,
recoveryTime: 6716,
secondsSinceLastUpdate: 301
}
After stamina update: {
uid: '8058-STARRAIL',
rate: 360,
currentStamina: 221.34,
maxStamina: 240,
recoveryTime: 6415,
message: '======================================'
}
---------------------------------------------------------------------
Current time: 1724780102033
Last update time: 1724779803321
Seconds since last update: 299
Before stamina update: {
message: '======================================',
uid: '1300-ZZZ',
rate: 360,
currentStamina: 122,
maxStamina: 240,
recoveryTime: 42259,
secondsSinceLastUpdate: 299
}
After stamina update: {
uid: '1300-ZZZ',
rate: 360,
currentStamina: 122.83,
maxStamina: 240,
recoveryTime: 41960,
message: '======================================'
}
---------------------------------------------------------------------
Hey, can you check the latest commit and let me know if anything goes wrong again, as usual don't forget to prune your cache.json
file again
hey, im just following up to see if everything works just as intended!
I tested the current version few time. It seems it is working fine. Thank you :)
that is good to hear!