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

GRCPRICE not being written to DB #54

Closed
Jericon opened this issue Jul 11, 2024 · 3 comments
Closed

GRCPRICE not being written to DB #54

Jericon opened this issue Jul 11, 2024 · 3 comments

Comments

@Jericon
Copy link

Jericon commented Jul 11, 2024

After my first run of the program, subsequent runs fail with the following error:

Traceback (most recent call last): File "/home/grcuser/FindTheMag2/main.py", line 5042, in <module> boinc_loop(False, rpc_client) File "/home/grcuser/FindTheMag2/main.py", line 4017, in boinc_loop grc_price = DATABASE["GRCPRICE"] KeyError: 'GRCPRICE'

It seems that in the stats.json file, the GRCPRICELASTCHECKED is being written, but the GRCPRICE is not. To resolve the issue, GRCPRICELASTCHECKED needs to be removed and then the client works fine. I believe this may be due to the price check failing to get a value, or the program failing to write a "0.000" GRCPRICE value to the "database".

@Jericon
Copy link
Author

Jericon commented Jul 11, 2024

I found a couple of things that can improve the behavior if there is no value in the database. Also, a logic fix that will prevent the LASTCHECKED value from being written if a price is not retrieved.

I am making a PR to fix those both now. However, potentially some error messages or something if a value cannot be obtained is warranted.

@Jericon
Copy link
Author

Jericon commented Jul 11, 2024

This PR will fix the issue by moving the update of the LASTCHECKED value to only be updated if a new price is attained. Likewise, it will run the block to try to get a new price if there is no value in the DB for GRCPRICE but there is a LASTUPDATED value.

#55

@makeasnek
Copy link
Owner

Fixed by #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

No branches or pull requests

2 participants